diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 380acbed43419..ce5aabe84659a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;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.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index efafdfe5c9411..44a102a054553 100644 --- a/pom.xml +++ b/pom.xml @@ -802,6 +802,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/network sdk/notificationhubs sdk/oep sdk/operationsmanagement 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..beb164a065ccd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-01) + +- Azure Resource Manager Network client library for Java. This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-08. 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..6f0e7aa628ccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Network client library for Java + +Azure Resource Manager Network client library for Java. + +This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-network-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-network-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +NetworkManager manager = NetworkManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[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](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md new file mode 100644 index 0000000000000..1c973fdbbab25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md @@ -0,0 +1,18531 @@ +# Code snippets and samples + + +## ApplicationGatewayPrivateEndpointConnections + +- [Delete](#applicationgatewayprivateendpointconnections_delete) +- [Get](#applicationgatewayprivateendpointconnections_get) +- [List](#applicationgatewayprivateendpointconnections_list) +- [Update](#applicationgatewayprivateendpointconnections_update) + +## ApplicationGatewayPrivateLinkResources + +- [List](#applicationgatewayprivatelinkresources_list) + +## 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) +- [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) + +## 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) + +## 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) + +## ExpressRouteServiceProviders + +- [List](#expressrouteserviceproviders_list) + +## FirewallPolicies + +- [CreateOrUpdate](#firewallpolicies_createorupdate) +- [Delete](#firewallpolicies_delete) +- [GetByResourceGroup](#firewallpolicies_getbyresourcegroup) +- [List](#firewallpolicies_list) +- [ListByResourceGroup](#firewallpolicies_listbyresourcegroup) + +## 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) + +## 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) + +## 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) + +## 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) +- [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) +- [Generatevirtualwanvpnserverconfigurationvpnprofile](#resourceprovider_generatevirtualwanvpnserverconfigurationvpnprofile) +- [GetActiveSessions](#resourceprovider_getactivesessions) +- [GetBastionShareableLink](#resourceprovider_getbastionshareablelink) +- [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) + +## 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) + +## 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) + +## Subnets + +- [CreateOrUpdate](#subnets_createorupdate) +- [Delete](#subnets_delete) +- [Get](#subnets_get) +- [List](#subnets_list) +- [PrepareNetworkPolicies](#subnets_preparenetworkpolicies) +- [UnprepareNetworkPolicies](#subnets_unpreparenetworkpolicies) + +## Usages + +- [List](#usages_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) +- [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) +- [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) +### ApplicationGatewayPrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections Delete. */ +public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections Get. */ +public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections List. */ +public final class ApplicationGatewayPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_Update + +```java +import com.azure.core.util.Context; +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/2021-08-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.")), + Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateLinkResources_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateLinkResources List. */ +public final class ApplicationGatewayPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_BackendHealth + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways BackendHealth. */ +public final class ApplicationGatewaysBackendHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### ApplicationGateways_BackendHealthOnDemand + +```java +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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/2021-08-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, + 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/2021-08-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("https://kv/secret"))) + .withTrustedClientCertificates( + Arrays.asList(new ApplicationGatewayTrustedClientCertificate().withName("clientcert").withData("****"))) + .withSslCertificates( + Arrays + .asList( + new ApplicationGatewaySslCertificate() + .withName("sslcert") + .withData("****") + .withPassword("****"), + new ApplicationGatewaySslCertificate() + .withName("sslcert2") + .withKeyVaultSecretId("https://kv/secret"))) + .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 +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Delete. */ +public final class ApplicationGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways GetByResourceGroup. */ +public final class ApplicationGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_GetSslPredefinedPolicy + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways GetSslPredefinedPolicy. */ +public final class ApplicationGatewaysGetSslPredefinedPolicySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways List. */ +public final class ApplicationGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableRequestHeaders + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableRequestHeaders. */ +public final class ApplicationGatewaysListAvailableRequestHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableResponseHeaders + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableResponseHeaders. */ +public final class ApplicationGatewaysListAvailableResponseHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableServerVariables + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableServerVariables. */ +public final class ApplicationGatewaysListAvailableServerVariablesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableSslOptions + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableSslOptions. */ +public final class ApplicationGatewaysListAvailableSslOptionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableSslPredefinedPolicies + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. */ +public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableWafRuleSets + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableWafRuleSets. */ +public final class ApplicationGatewaysListAvailableWafRuleSetsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListByResourceGroup. */ +public final class ApplicationGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Start. */ +public final class ApplicationGatewaysStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Stop. */ +public final class ApplicationGatewaysStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups Delete. */ +public final class ApplicationSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups GetByResourceGroup. */ +public final class ApplicationSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups List. */ +public final class ApplicationSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups ListByResourceGroup. */ +public final class ApplicationSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for AvailableDelegations List. */ +public final class AvailableDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailableEndpointServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableEndpointServices List. */ +public final class AvailableEndpointServicesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailablePrivateEndpointTypes_List + +```java +import com.azure.core.util.Context; + +/** Samples for AvailablePrivateEndpointTypes List. */ +public final class AvailablePrivateEndpointTypesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailablePrivateEndpointTypes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AvailablePrivateEndpointTypes ListByResourceGroup. */ +public final class AvailablePrivateEndpointTypesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailableResourceGroupDelegations_List + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableResourceGroupDelegations List. */ +public final class AvailableResourceGroupDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailableServiceAliases_List + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableServiceAliases List. */ +public final class AvailableServiceAliasesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AvailableServiceAliases_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableServiceAliases ListByResourceGroup. */ +public final class AvailableServiceAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AzureFirewallFqdnTags_List + +```java +import com.azure.core.util.Context; + +/** Samples for AzureFirewallFqdnTags List. */ +public final class AzureFirewallFqdnTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls Delete. */ +public final class AzureFirewallsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AzureFirewalls_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls GetByResourceGroup. */ +public final class AzureFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AzureFirewalls_List + +```java +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls List. */ +public final class AzureFirewallsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### AzureFirewalls_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls ListByResourceGroup. */ +public final class AzureFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### AzureFirewalls_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for BastionHosts Delete. */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### BastionHosts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts GetByResourceGroup. */ +public final class BastionHostsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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'", Context.NONE); + } +} +``` + +### BastionHosts_List + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts List. */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### BastionHosts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for BastionHosts ListByResourceGroup. */ +public final class BastionHostsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### BastionHosts_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for BgpServiceCommunities List. */ +public final class BgpServiceCommunitiesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Delete. */ +public final class ConnectionMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Get. */ +public final class ConnectionMonitorsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_List + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors List. */ +public final class ConnectionMonitorsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_Query + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Query. */ +public final class ConnectionMonitorsQuerySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Start. */ +public final class ConnectionMonitorsStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Stop. */ +public final class ConnectionMonitorsStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ConnectionMonitors_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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; + } +} +``` + +### CustomIpPrefixes_CreateOrUpdate + +```java +/** Samples for CustomIpPrefixes CreateOrUpdate. */ +public final class CustomIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes Delete. */ +public final class CustomIpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### CustomIpPrefixes_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes GetByResourceGroup. */ +public final class CustomIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### CustomIpPrefixes_List + +```java +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes List. */ +public final class CustomIpPrefixesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### CustomIpPrefixes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes ListByResourceGroup. */ +public final class CustomIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### CustomIpPrefixes_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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 +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicyProtocol; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import java.util.Arrays; + +/** Samples for DdosCustomPolicies CreateOrUpdate. */ +public final class DdosCustomPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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") + .withProtocolCustomSettings( + Arrays.asList(new ProtocolCustomSettingsFormat().withProtocol(DdosCustomPolicyProtocol.TCP))) + .create(); + } +} +``` + +### DdosCustomPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DdosCustomPolicies Delete. */ +public final class DdosCustomPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DdosCustomPolicies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DdosCustomPolicies GetByResourceGroup. */ +public final class DdosCustomPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DdosCustomPolicies_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans Delete. */ +public final class DdosProtectionPlansDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DdosProtectionPlans_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans GetByResourceGroup. */ +public final class DdosProtectionPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DdosProtectionPlans_List + +```java +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans List. */ +public final class DdosProtectionPlansListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### DdosProtectionPlans_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans ListByResourceGroup. */ +public final class DdosProtectionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DdosProtectionPlans_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for DefaultSecurityRules Get. */ +public final class DefaultSecurityRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DefaultSecurityRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for DefaultSecurityRules List. */ +public final class DefaultSecurityRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration Delete. */ +public final class DscpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DscpConfiguration_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration GetByResourceGroup. */ +public final class DscpConfigurationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### DscpConfiguration_List + +```java +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration List. */ +public final class DscpConfigurationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### DscpConfiguration_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration ListByResourceGroup. */ +public final class DscpConfigurationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_CreateOrUpdate + +```java +/** Samples for ExpressRouteCircuitAuthorizations CreateOrUpdate. */ +public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations Delete. */ +public final class ExpressRouteCircuitAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations Get. */ +public final class ExpressRouteCircuitAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations List. */ +public final class ExpressRouteCircuitAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections Delete. */ +public final class ExpressRouteCircuitConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections Get. */ +public final class ExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections List. */ +public final class ExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_CreateOrUpdate + +```java +/** Samples for ExpressRouteCircuitPeerings CreateOrUpdate. */ +public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings Delete. */ +public final class ExpressRouteCircuitPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings Get. */ +public final class ExpressRouteCircuitPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings List. */ +public final class ExpressRouteCircuitPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits Delete. */ +public final class ExpressRouteCircuitsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetByResourceGroup. */ +public final class ExpressRouteCircuitsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetPeeringStats + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetPeeringStats. */ +public final class ExpressRouteCircuitsGetPeeringStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetStats + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetStats. */ +public final class ExpressRouteCircuitsGetStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits List. */ +public final class ExpressRouteCircuitsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListArpTable + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListArpTable. */ +public final class ExpressRouteCircuitsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListByResourceGroup. */ +public final class ExpressRouteCircuitsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListRoutesTable + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListRoutesTable. */ +public final class ExpressRouteCircuitsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListRoutesTableSummary + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListRoutesTableSummary. */ +public final class ExpressRouteCircuitsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCircuits_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; + +/** Samples for ExpressRouteConnections CreateOrUpdate. */ +public final class ExpressRouteConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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("authorizationKey") + .withRoutingWeight(2), + Context.NONE); + } +} +``` + +### ExpressRouteConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteConnections Delete. */ +public final class ExpressRouteConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteConnections Get. */ +public final class ExpressRouteConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteConnections List. */ +public final class ExpressRouteConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings Delete. */ +public final class ExpressRouteCrossConnectionPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings Get. */ +public final class ExpressRouteCrossConnectionPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings List. */ +public final class ExpressRouteCrossConnectionPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", "", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections GetByResourceGroup. */ +public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", "", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections List. */ +public final class ExpressRouteCrossConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListArpTable + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListArpTable. */ +public final class ExpressRouteCrossConnectionsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListByResourceGroup. */ +public final class ExpressRouteCrossConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListRoutesTable + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListRoutesTable. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListRoutesTableSummary + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListRoutesTableSummary. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", "", 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/2021-08-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")) + .create(); + } +} +``` + +### ExpressRouteGateways_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways Delete. */ +public final class ExpressRouteGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways GetByResourceGroup. */ +public final class ExpressRouteGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways ListByResourceGroup. */ +public final class ExpressRouteGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteGateways_ListBySubscription + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways ListBySubscription. */ +public final class ExpressRouteGatewaysListBySubscriptionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ExpressRouteGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for ExpressRouteLinks Get. */ +public final class ExpressRouteLinksGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRouteLinks_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteLinks List. */ +public final class ExpressRouteLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_CreateOrUpdate + +```java +/** Samples for ExpressRoutePortAuthorizations CreateOrUpdate. */ +public final class ExpressRoutePortAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations Delete. */ +public final class ExpressRoutePortAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations Get. */ +public final class ExpressRoutePortAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations List. */ +public final class ExpressRoutePortAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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.ExpressRoutePortsEncapsulation; +import java.util.Arrays; + +/** Samples for ExpressRoutePorts CreateOrUpdate. */ +public final class ExpressRoutePortsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .create(); + } +} +``` + +### ExpressRoutePorts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts Delete. */ +public final class ExpressRoutePortsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePorts_GenerateLoa + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### ExpressRoutePorts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts GetByResourceGroup. */ +public final class ExpressRoutePortsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePorts_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts List. */ +public final class ExpressRoutePortsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ExpressRoutePorts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts ListByResourceGroup. */ +public final class ExpressRoutePortsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePorts_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortsLocations Get. */ +public final class ExpressRoutePortsLocationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ExpressRoutePortsLocations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortsLocations List. */ +public final class ExpressRoutePortsLocationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ExpressRouteServiceProviders_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExpressRouteServiceProviders List. */ +public final class ExpressRouteServiceProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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.ExplicitProxySettings; +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/2021-08-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)) + .withExplicitProxySettings( + new ExplicitProxySettings() + .withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .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("https://kv/secret") + .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 +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies Delete. */ +public final class FirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies GetByResourceGroup. */ +public final class FirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### FirewallPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies List. */ +public final class FirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### FirewallPolicies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies ListByResourceGroup. */ +public final class FirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignatures_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.models.FilterItems; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import com.azure.resourcemanager.network.generated.models.OrderBy; +import com.azure.resourcemanager.network.generated.models.OrderByOrder; +import java.util.Arrays; + +/** Samples for FirewallPolicyIdpsSignatures List. */ +public final class FirewallPolicyIdpsSignaturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(OrderByOrder.ASCENDING)) + .withResultsPerPage(20) + .withSkip(0), + Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesFilterValues_List + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyIdpsSignaturesOverrides Get. */ +public final class FirewallPolicyIdpsSignaturesOverridesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_List + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyIdpsSignaturesOverrides List. */ +public final class FirewallPolicyIdpsSignaturesOverridesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_Patch + +```java +import com.azure.core.util.Context; +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/2021-08-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"))), + 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.core.util.Context; +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/2021-08-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"))), + 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/2021-08-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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups Delete. */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups Get. */ +public final class FirewallPolicyRuleCollectionGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups List. */ +public final class FirewallPolicyRuleCollectionGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for FlowLogs Delete. */ +public final class FlowLogsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FlowLogs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FlowLogs Get. */ +public final class FlowLogsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FlowLogs_List + +```java +import com.azure.core.util.Context; + +/** Samples for FlowLogs List. */ +public final class FlowLogsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### FlowLogs_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for HubRouteTables Delete. */ +public final class HubRouteTablesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### HubRouteTables_Get + +```java +import com.azure.core.util.Context; + +/** Samples for HubRouteTables Get. */ +public final class HubRouteTablesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### HubRouteTables_List + +```java +import com.azure.core.util.Context; + +/** Samples for HubRouteTables List. */ +public final class HubRouteTablesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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.VnetRoute; +import java.util.Arrays; + +/** Samples for HubVirtualNetworkConnections CreateOrUpdate. */ +public final class HubVirtualNetworkConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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() + .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"))))), + Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections Delete. */ +public final class HubVirtualNetworkConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections Get. */ +public final class HubVirtualNetworkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections List. */ +public final class HubVirtualNetworkConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for InboundNatRules Delete. */ +public final class InboundNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### InboundNatRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for InboundNatRules Get. */ +public final class InboundNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### InboundNatRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for InboundNatRules List. */ +public final class InboundNatRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for IpAllocations Delete. */ +public final class IpAllocationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### IpAllocations_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IpAllocations GetByResourceGroup. */ +public final class IpAllocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### IpAllocations_List + +```java +import com.azure.core.util.Context; + +/** Samples for IpAllocations List. */ +public final class IpAllocationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### IpAllocations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IpAllocations ListByResourceGroup. */ +public final class IpAllocationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### IpAllocations_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for IpGroups Delete. */ +public final class IpGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### IpGroups_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IpGroups GetByResourceGroup. */ +public final class IpGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### IpGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for IpGroups List. */ +public final class IpGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### IpGroups_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IpGroups ListByResourceGroup. */ +public final class IpGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### IpGroups_UpdateGroups + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools Delete. */ +public final class LoadBalancerBackendAddressPoolsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerBackendAddressPools_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools Get. */ +public final class LoadBalancerBackendAddressPoolsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerBackendAddressPools_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools List. */ +public final class LoadBalancerBackendAddressPoolsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerFrontendIpConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerFrontendIpConfigurations Get. */ +public final class LoadBalancerFrontendIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerFrontendIpConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerFrontendIpConfigurations List. */ +public final class LoadBalancerFrontendIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerLoadBalancingRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerLoadBalancingRules Get. */ +public final class LoadBalancerLoadBalancingRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerLoadBalancingRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerLoadBalancingRules List. */ +public final class LoadBalancerLoadBalancingRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerNetworkInterfaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerNetworkInterfaces List. */ +public final class LoadBalancerNetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerOutboundRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerOutboundRules Get. */ +public final class LoadBalancerOutboundRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerOutboundRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerOutboundRules List. */ +public final class LoadBalancerOutboundRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerProbes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerProbes Get. */ +public final class LoadBalancerProbesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancerProbes_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancerProbes List. */ +public final class LoadBalancerProbesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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/2021-08-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) + .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/2021-08-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) + .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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .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/2021-08-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) + .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 +import com.azure.core.util.Context; + +/** Samples for LoadBalancers Delete. */ +public final class LoadBalancersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancers_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancers GetByResourceGroup. */ +public final class LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### LoadBalancers_List + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancers List. */ +public final class LoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### LoadBalancers_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LoadBalancers ListByResourceGroup. */ +public final class LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LoadBalancers_ListInboundNatRulePortMappings + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### LoadBalancers_SwapPublicIpAddresses + +```java +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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/2021-08-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")))), + Context.NONE); + } +} +``` + +### LoadBalancers_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways Delete. */ +public final class LocalNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LocalNetworkGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways GetByResourceGroup. */ +public final class LocalNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LocalNetworkGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways ListByResourceGroup. */ +public final class LocalNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### LocalNetworkGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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; + } +} +``` + +### 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NatGateways Delete. */ +public final class NatGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NatGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NatGateways GetByResourceGroup. */ +public final class NatGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NatGateways_List + +```java +import com.azure.core.util.Context; + +/** Samples for NatGateways List. */ +public final class NatGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NatGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NatGateways ListByResourceGroup. */ +public final class NatGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NatGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NatRules Delete. */ +public final class NatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NatRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for NatRules Get. */ +public final class NatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NatRules_ListByVpnGateway + +```java +import com.azure.core.util.Context; + +/** Samples for NatRules ListByVpnGateway. */ +public final class NatRulesListByVpnGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaceIpConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceIpConfigurations Get. */ +public final class NetworkInterfaceIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaceIpConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceIpConfigurations List. */ +public final class NetworkInterfaceIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaceLoadBalancers_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceLoadBalancers List. */ +public final class NetworkInterfaceLoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations Delete. */ +public final class NetworkInterfaceTapConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaceTapConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations Get. */ +public final class NetworkInterfaceTapConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaceTapConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations List. */ +public final class NetworkInterfaceTapConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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) + .create(); + } +} +``` + +### NetworkInterfaces_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces Delete. */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetByResourceGroup. */ +public final class NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkInterfaces_GetCloudServiceNetworkInterface + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetCloudServiceNetworkInterface. */ +public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkInterfaces_GetEffectiveRouteTable + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetEffectiveRouteTable. */ +public final class NetworkInterfacesGetEffectiveRouteTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_GetVirtualMachineScaleSetIpConfiguration + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetVirtualMachineScaleSetIpConfiguration. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkInterfaces_GetVirtualMachineScaleSetNetworkInterface + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetVirtualMachineScaleSetNetworkInterface. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkInterfaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces List. */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NetworkInterfaces_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListByResourceGroup. */ +public final class NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_ListCloudServiceNetworkInterfaces + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_ListCloudServiceRoleInstanceNetworkInterfaces + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListCloudServiceRoleInstanceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_ListEffectiveNetworkSecurityGroups + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. */ +public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetIpConfigurations + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetIpConfigurations. */ +public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetNetworkInterfaces + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetVMNetworkInterfaces + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetVMNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkInterfaces_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles Delete. */ +public final class NetworkProfilesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkProfiles_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles GetByResourceGroup. */ +public final class NetworkProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkProfiles_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles List. */ +public final class NetworkProfilesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NetworkProfiles_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles ListByResourceGroup. */ +public final class NetworkProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkProfiles_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups Delete. */ +public final class NetworkSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkSecurityGroups_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups GetByResourceGroup. */ +public final class NetworkSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkSecurityGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups List. */ +public final class NetworkSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NetworkSecurityGroups_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups ListByResourceGroup. */ +public final class NetworkSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkSecurityGroups_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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.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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances Delete. */ +public final class NetworkVirtualAppliancesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances GetByResourceGroup. */ +public final class NetworkVirtualAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances List. */ +public final class NetworkVirtualAppliancesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances ListByResourceGroup. */ +public final class NetworkVirtualAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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.core.util.Context; +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/2021-08-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), + Context.NONE); + } +} +``` + +### NetworkWatchers_CreateOrUpdate + +```java +/** Samples for NetworkWatchers CreateOrUpdate. */ +public final class NetworkWatchersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers Delete. */ +public final class NetworkWatchersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkWatchers_GetAzureReachabilityReport + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers GetByResourceGroup. */ +public final class NetworkWatchersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkWatchers_GetFlowLogStatus + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetNetworkConfigurationDiagnostic + +```java +import com.azure.core.util.Context; +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/2021-08-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"))), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetNextHop + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetTopology + +```java +import com.azure.core.util.Context; +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/2021-08-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"), Context.NONE); + } +} +``` + +### NetworkWatchers_GetTroubleshooting + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetTroubleshootingResult + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_GetVMSecurityRules + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_List + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers List. */ +public final class NetworkWatchersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### NetworkWatchers_ListAvailableProviders + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### NetworkWatchers_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers ListByResourceGroup. */ +public final class NetworkWatchersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### NetworkWatchers_SetFlowLogConfiguration + +```java +import com.azure.core.util.Context; +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/2021-08-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), + Context.NONE); + } +} +``` + +### NetworkWatchers_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways Delete. */ +public final class P2SVpnGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### P2SVpnGateways_DisconnectP2SVpnConnections + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### P2SVpnGateways_GenerateVpnProfile + +```java +import com.azure.core.util.Context; +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/2021-08-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), + Context.NONE); + } +} +``` + +### P2SVpnGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways GetByResourceGroup. */ +public final class P2SVpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### P2SVpnGateways_GetP2SVpnConnectionHealth + +```java +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways GetP2SVpnConnectionHealth. */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### P2SVpnGateways_GetP2SVpnConnectionHealthDetailed + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### P2SVpnGateways_List + +```java +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways List. */ +public final class P2SVpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### P2SVpnGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways ListByResourceGroup. */ +public final class P2SVpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### P2SVpnGateways_Reset + +```java +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways Reset. */ +public final class P2SVpnGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### P2SVpnGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.core.util.Context; +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/2021-08-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"))), + Context.NONE); + } +} +``` + +### PacketCaptures_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Delete. */ +public final class PacketCapturesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PacketCaptures_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Get. */ +public final class PacketCapturesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PacketCaptures_GetStatus + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCaptures GetStatus. */ +public final class PacketCapturesGetStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PacketCaptures_List + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCaptures List. */ +public final class PacketCapturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PacketCaptures_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Stop. */ +public final class PacketCapturesStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PeerExpressRouteCircuitConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PeerExpressRouteCircuitConnections Get. */ +public final class PeerExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", + Context.NONE); + } +} +``` + +### PeerExpressRouteCircuitConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeerExpressRouteCircuitConnections List. */ +public final class PeerExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/2021-08-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"))), + Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups Delete. */ +public final class PrivateDnsZoneGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups Get. */ +public final class PrivateDnsZoneGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups List. */ +public final class PrivateDnsZoneGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints Delete. */ +public final class PrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateEndpoints_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints GetByResourceGroup. */ +public final class PrivateEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PrivateEndpoints_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints List. */ +public final class PrivateEndpointsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### PrivateEndpoints_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints ListByResourceGroup. */ +public final class PrivateEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_CheckPrivateLinkServiceVisibility + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices Delete. */ +public final class PrivateLinkServicesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_DeletePrivateEndpointConnection + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices DeletePrivateEndpointConnection. */ +public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices GetByResourceGroup. */ +public final class PrivateLinkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PrivateLinkServices_GetPrivateEndpointConnection + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices GetPrivateEndpointConnection. */ +public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PrivateLinkServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices List. */ +public final class PrivateLinkServicesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### PrivateLinkServices_ListAutoApprovedPrivateLinkServices + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServices. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServicesByResourceGroup. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListByResourceGroup. */ +public final class PrivateLinkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_ListPrivateEndpointConnections + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListPrivateEndpointConnections. */ +public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PrivateLinkServices_UpdatePrivateEndpointConnection + +```java +import com.azure.core.util.Context; +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/2021-08-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.")), + 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/2021-08-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/2021-08-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/2021-08-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_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses Delete. */ +public final class PublicIpAddressesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetByResourceGroup. */ +public final class PublicIpAddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PublicIpAddresses_GetCloudServicePublicIpAddress + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetCloudServicePublicIpAddress. */ +public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PublicIpAddresses_GetVirtualMachineScaleSetPublicIpAddress + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetVirtualMachineScaleSetPublicIpAddress. */ +public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PublicIpAddresses_List + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses List. */ +public final class PublicIpAddressesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### PublicIpAddresses_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListByResourceGroup. */ +public final class PublicIpAddressesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_ListCloudServicePublicIpAddresses + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListCloudServicePublicIpAddresses. */ +public final class PublicIpAddressesListCloudServicePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_ListCloudServiceRoleInstancePublicIpAddresses + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListCloudServiceRoleInstancePublicIpAddresses. */ +public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_ListVirtualMachineScaleSetPublicIpAddresses + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListVirtualMachineScaleSetPublicIpAddresses. */ +public final class PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_ListVirtualMachineScaleSetVMPublicIpAddresses + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListVirtualMachineScaleSetVMPublicIpAddresses. */ +public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpAddresses_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes Delete. */ +public final class PublicIpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpPrefixes_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes GetByResourceGroup. */ +public final class PublicIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### PublicIpPrefixes_List + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes List. */ +public final class PublicIpPrefixesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### PublicIpPrefixes_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes ListByResourceGroup. */ +public final class PublicIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### PublicIpPrefixes_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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 +import com.azure.core.util.Context; + +/** Samples for ResourceNavigationLinks List. */ +public final class ResourceNavigationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ResourceProvider_CheckDnsNameAvailability + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider CheckDnsNameAvailability. */ +public final class ResourceProviderCheckDnsNameAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ResourceProvider_DeleteBastionShareableLink + +```java +import com.azure.core.util.Context; +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/2021-08-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")))), + Context.NONE); + } +} +``` + +### ResourceProvider_DisconnectActiveSessions + +```java +import com.azure.core.util.Context; +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/2021-08-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(), Context.NONE); + } +} +``` + +### ResourceProvider_Generatevirtualwanvpnserverconfigurationvpnprofile + +```java +import com.azure.core.util.Context; +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/2021-08-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), + Context.NONE); + } +} +``` + +### ResourceProvider_GetActiveSessions + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetActiveSessions. */ +public final class ResourceProviderGetActiveSessionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ResourceProvider_GetBastionShareableLink + +```java +import com.azure.core.util.Context; +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/2021-08-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")))), + Context.NONE); + } +} +``` + +### ResourceProvider_PutBastionShareableLink + +```java +import com.azure.core.util.Context; +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/2021-08-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")))), + Context.NONE); + } +} +``` + +### ResourceProvider_SupportedSecurityProviders + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SupportedSecurityProviders. */ +public final class ResourceProviderSupportedSecurityProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteFilterRules_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### RouteFilterRules_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules Delete. */ +public final class RouteFilterRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteFilterRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules Get. */ +public final class RouteFilterRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteFilterRules_ListByRouteFilter + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules ListByRouteFilter. */ +public final class RouteFilterRulesListByRouteFilterSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for RouteFilters Delete. */ +public final class RouteFiltersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteFilters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilters GetByResourceGroup. */ +public final class RouteFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### RouteFilters_List + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilters List. */ +public final class RouteFiltersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### RouteFilters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RouteFilters ListByResourceGroup. */ +public final class RouteFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteFilters_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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; + } +} +``` + +### 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for RouteTables Delete. */ +public final class RouteTablesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteTables_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RouteTables GetByResourceGroup. */ +public final class RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### RouteTables_List + +```java +import com.azure.core.util.Context; + +/** Samples for RouteTables List. */ +public final class RouteTablesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### RouteTables_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RouteTables ListByResourceGroup. */ +public final class RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RouteTables_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for Routes Delete. */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### Routes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Routes Get. */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### Routes_List + +```java +import com.azure.core.util.Context; + +/** Samples for Routes List. */ +public final class RoutesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for RoutingIntent Delete. */ +public final class RoutingIntentDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RoutingIntent_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RoutingIntent Get. */ +public final class RoutingIntentGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### RoutingIntent_List + +```java +import com.azure.core.util.Context; + +/** Samples for RoutingIntent List. */ +public final class RoutingIntentListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders Delete. */ +public final class SecurityPartnerProvidersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### SecurityPartnerProviders_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders GetByResourceGroup. */ +public final class SecurityPartnerProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### SecurityPartnerProviders_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders List. */ +public final class SecurityPartnerProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### SecurityPartnerProviders_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders ListByResourceGroup. */ +public final class SecurityPartnerProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### SecurityPartnerProviders_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for SecurityRules Delete. */ +public final class SecurityRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### SecurityRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityRules Get. */ +public final class SecurityRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### SecurityRules_List + +```java +import com.azure.core.util.Context; + +/** Samples for SecurityRules List. */ +public final class SecurityRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceAssociationLinks_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceAssociationLinks List. */ +public final class ServiceAssociationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies Delete. */ +public final class ServiceEndpointPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies GetByResourceGroup. */ +public final class ServiceEndpointPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies List. */ +public final class ServiceEndpointPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies ListByResourceGroup. */ +public final class ServiceEndpointPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions Delete. */ +public final class ServiceEndpointPolicyDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceEndpointPolicyDefinitions_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions Get. */ +public final class ServiceEndpointPolicyDefinitionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceEndpointPolicyDefinitions_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions ListByResourceGroup. */ +public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceTagInformation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTagInformation List. */ +public final class ServiceTagInformationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### ServiceTags_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTags List. */ +public final class ServiceTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for Subnets Delete. */ +public final class SubnetsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### Subnets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Subnets Get. */ +public final class SubnetsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### Subnets_List + +```java +import com.azure.core.util.Context; + +/** Samples for Subnets List. */ +public final class SubnetsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### Subnets_PrepareNetworkPolicies + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### Subnets_UnprepareNetworkPolicies + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### Usages_List + +```java +import com.azure.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites Delete. */ +public final class VirtualApplianceSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualApplianceSites_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites Get. */ +public final class VirtualApplianceSitesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualApplianceSites_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites List. */ +public final class VirtualApplianceSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualApplianceSkus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSkus Get. */ +public final class VirtualApplianceSkusGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualApplianceSkus_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSkus List. */ +public final class VirtualApplianceSkusListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections Delete. */ +public final class VirtualHubBgpConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections Get. */ +public final class VirtualHubBgpConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections List. */ +public final class VirtualHubBgpConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_ListAdvertisedRoutes + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections ListAdvertisedRoutes. */ +public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_ListLearnedRoutes + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections ListLearnedRoutes. */ +public final class VirtualHubBgpConnectionsListLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration Delete. */ +public final class VirtualHubIpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubIpConfiguration_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration Get. */ +public final class VirtualHubIpConfigurationGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubIpConfiguration_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration List. */ +public final class VirtualHubIpConfigurationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_CreateOrUpdate + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S Delete. */ +public final class VirtualHubRouteTableV2SDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S Get. */ +public final class VirtualHubRouteTableV2SGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S List. */ +public final class VirtualHubRouteTableV2SListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualHubs Delete. */ +public final class VirtualHubsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubs_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubs GetByResourceGroup. */ +public final class VirtualHubsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubs_GetEffectiveVirtualHubRoutes + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualHubs_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubs List. */ +public final class VirtualHubsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VirtualHubs_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualHubs ListByResourceGroup. */ +public final class VirtualHubsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualHubs_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.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/2021-08-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) + .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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections Delete. */ +public final class VirtualNetworkGatewayConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetIkeSas + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetIkeSas. */ +public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetSharedKey + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetSharedKey. */ +public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections ListByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ResetConnection + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections ResetConnection. */ +public final class VirtualNetworkGatewayConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ResetSharedKey + +```java +import com.azure.core.util.Context; +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/2021-08-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), Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_SetSharedKey + +```java +import com.azure.core.util.Context; +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/2021-08-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"), Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_StartPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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}]}"), + Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_StopPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules Delete. */ +public final class VirtualNetworkGatewayNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayNatRules_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules Get. */ +public final class VirtualNetworkGatewayNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGatewayNatRules_ListByVirtualNetworkGateway + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. */ +public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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("radiusServerSecret")))) + .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) + .create(); + } +} +``` + +### VirtualNetworkGateways_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways Delete. */ +public final class VirtualNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_DisconnectVirtualNetworkGatewayVpnConnections + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GenerateVpnProfile + +```java +import com.azure.core.util.Context; +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/2021-08-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(), Context.NONE); + } +} +``` + +### VirtualNetworkGateways_Generatevpnclientpackage + +```java +import com.azure.core.util.Context; +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/2021-08-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(), Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetAdvertisedRoutes + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetAdvertisedRoutes. */ +public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetBgpPeerStatus + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetBgpPeerStatus. */ +public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetByResourceGroup. */ +public final class VirtualNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetLearnedRoutes + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetLearnedRoutes. */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnProfilePackageUrl + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. */ +public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnclientConnectionHealth + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnclientConnectionHealth. */ +public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnclientIpsecParameters + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. */ +public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ListByResourceGroup. */ +public final class VirtualNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ListConnections + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ListConnections. */ +public final class VirtualNetworkGatewaysListConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_Reset + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways Reset. */ +public final class VirtualNetworkGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ResetVpnClientSharedKey + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ResetVpnClientSharedKey. */ +public final class VirtualNetworkGatewaysResetVpnClientSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_SetVpnclientIpsecParameters + +```java +import com.azure.core.util.Context; +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/2021-08-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), + Context.NONE); + } +} +``` + +### VirtualNetworkGateways_StartPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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}]}"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualNetworkGateways_StopPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### VirtualNetworkGateways_SupportedVpnDevices + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways SupportedVpnDevices. */ +public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.core.util.Context; +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/2021-08-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)"), + 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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkPeerings Delete. */ +public final class VirtualNetworkPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkPeerings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkPeerings Get. */ +public final class VirtualNetworkPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkPeerings_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkPeerings List. */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps Delete. */ +public final class VirtualNetworkTapsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkTaps_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps GetByResourceGroup. */ +public final class VirtualNetworkTapsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkTaps_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps List. */ +public final class VirtualNetworkTapsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VirtualNetworkTaps_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps ListByResourceGroup. */ +public final class VirtualNetworkTapsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworkTaps_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks CheckIpAddressAvailability. */ +public final class VirtualNetworksCheckIpAddressAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworks_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks GetByResourceGroup. */ +public final class VirtualNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualNetworks_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VirtualNetworks_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks ListByResourceGroup. */ +public final class VirtualNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworks_ListUsage + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks ListUsage. */ +public final class VirtualNetworksListUsageSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualNetworks_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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, 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings Delete. */ +public final class VirtualRouterPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualRouterPeerings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings Get. */ +public final class VirtualRouterPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualRouterPeerings_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings List. */ +public final class VirtualRouterPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualRouters Delete. */ +public final class VirtualRoutersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualRouters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualRouters GetByResourceGroup. */ +public final class VirtualRoutersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VirtualRouters_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualRouters List. */ +public final class VirtualRoutersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VirtualRouters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualRouters ListByResourceGroup. */ +public final class VirtualRoutersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VirtualWans Delete. */ +public final class VirtualWansDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualWans_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualWans GetByResourceGroup. */ +public final class VirtualWansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualWans_List + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualWans List. */ +public final class VirtualWansListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VirtualWans_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VirtualWans ListByResourceGroup. */ +public final class VirtualWansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VirtualWans_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.core.util.Context; +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.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/2021-08-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("key") + .withUsePolicyBasedTrafficSelectors(false))), + Context.NONE); + } +} +``` + +### VpnConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VpnConnections Delete. */ +public final class VpnConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VpnConnections Get. */ +public final class VpnConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnConnections_ListByVpnGateway + +```java +import com.azure.core.util.Context; + +/** Samples for VpnConnections ListByVpnGateway. */ +public final class VpnConnectionsListByVpnGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnConnections_StartPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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")), + Context.NONE); + } +} +``` + +### VpnConnections_StopPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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")), + 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/2021-08-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("key") + .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 +import com.azure.core.util.Context; + +/** Samples for VpnGateways Delete. */ +public final class VpnGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnGateways_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnGateways GetByResourceGroup. */ +public final class VpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnGateways_List + +```java +import com.azure.core.util.Context; + +/** Samples for VpnGateways List. */ +public final class VpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VpnGateways_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnGateways ListByResourceGroup. */ +public final class VpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnGateways_Reset + +```java +import com.azure.core.util.Context; + +/** Samples for VpnGateways Reset. */ +public final class VpnGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnGateways_StartPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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}]}"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### VpnGateways_StopPacketCapture + +```java +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### VpnGateways_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for VpnLinkConnections GetIkeSas. */ +public final class VpnLinkConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnLinkConnections_ListByVpnConnection + +```java +import com.azure.core.util.Context; + +/** Samples for VpnLinkConnections ListByVpnConnection. */ +public final class VpnLinkConnectionsListByVpnConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnLinkConnections_ResetConnection + +```java +import com.azure.core.util.Context; + +/** Samples for VpnLinkConnections ResetConnection. */ +public final class VpnLinkConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnServerConfigurations_CreateOrUpdate + +```java +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.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import java.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/2021-08-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("radiusServerSecret"))) + .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 +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations Delete. */ +public final class VpnServerConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnServerConfigurations_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations GetByResourceGroup. */ +public final class VpnServerConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnServerConfigurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations List. */ +public final class VpnServerConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VpnServerConfigurations_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations ListByResourceGroup. */ +public final class VpnServerConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnServerConfigurations_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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 +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurationsAssociatedWithVirtualWan List. */ +public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSiteLinkConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinkConnections Get. */ +public final class VpnSiteLinkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSiteLinks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinks Get. */ +public final class VpnSiteLinksGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSiteLinks_ListByVpnSite + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinks ListByVpnSite. */ +public final class VpnSiteLinksListByVpnSiteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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/2021-08-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 +import com.azure.core.util.Context; + +/** Samples for VpnSites Delete. */ +public final class VpnSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSites_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSites GetByResourceGroup. */ +public final class VpnSitesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSites_List + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSites List. */ +public final class VpnSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### VpnSites_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for VpnSites ListByResourceGroup. */ +public final class VpnSitesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### VpnSites_UpdateTags + +```java +import com.azure.core.util.Context; +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/2021-08-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", 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.core.util.Context; +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/2021-08-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"), + Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_CreateOrUpdate + +```java +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.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/2021-08-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")))) + .create(); + } +} +``` + +### WebApplicationFirewallPolicies_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies Delete. */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies GetByResourceGroup. */ +public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies List. */ +public final class WebApplicationFirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies ListByResourceGroup. */ +public final class WebApplicationFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } +} +``` + +### WebCategories_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WebCategories Get. */ +public final class WebCategoriesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } +} +``` + +### WebCategories_List + +```java +import com.azure.core.util.Context; + +/** Samples for WebCategories List. */ +public final class WebCategoriesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..f8efbd79cd9d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-network-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Network Management + This package contains Microsoft Azure SDK for Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Network Client. Package tag package-2021-08. + 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 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.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..a83b9ec5afaf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java @@ -0,0 +1,1643 @@ +// Copyright (c) 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.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateLinkResourcesImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableDelegationsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableEndpointServicesImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailablePrivateEndpointTypesImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableResourceGroupDelegationsImpl; +import com.azure.resourcemanager.network.generated.implementation.AvailableServiceAliasesImpl; +import com.azure.resourcemanager.network.generated.implementation.AzureFirewallFqdnTagsImpl; +import com.azure.resourcemanager.network.generated.implementation.AzureFirewallsImpl; +import com.azure.resourcemanager.network.generated.implementation.BastionHostsImpl; +import com.azure.resourcemanager.network.generated.implementation.BgpServiceCommunitiesImpl; +import com.azure.resourcemanager.network.generated.implementation.ConnectionMonitorsImpl; +import com.azure.resourcemanager.network.generated.implementation.CustomIpPrefixesImpl; +import com.azure.resourcemanager.network.generated.implementation.DdosCustomPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.DdosProtectionPlansImpl; +import com.azure.resourcemanager.network.generated.implementation.DefaultSecurityRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.DscpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitAuthorizationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortAuthorizationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsLocationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteServiceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.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.NatGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.NatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceIpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceLoadBalancersImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceTapConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkInterfacesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkManagementClientBuilder; +import com.azure.resourcemanager.network.generated.implementation.NetworkProfilesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkVirtualAppliancesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkWatchersImpl; +import com.azure.resourcemanager.network.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.network.generated.implementation.P2SVpnGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.PacketCapturesImpl; +import com.azure.resourcemanager.network.generated.implementation.PeerExpressRouteCircuitConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateDnsZoneGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateEndpointsImpl; +import com.azure.resourcemanager.network.generated.implementation.PrivateLinkServicesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpAddressesImpl; +import com.azure.resourcemanager.network.generated.implementation.PublicIpPrefixesImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceNavigationLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFilterRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteFiltersImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteTablesImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutesImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutingIntentsImpl; +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.SubnetsImpl; +import com.azure.resourcemanager.network.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSitesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSkusImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubBgpConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubIpConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubRouteTableV2SImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualHubsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayNatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworkTapsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualNetworksImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualRouterPeeringsImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualRoutersImpl; +import com.azure.resourcemanager.network.generated.implementation.VirtualWansImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnLinkConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsAssociatedWithVirtualWansImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinkConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSiteLinksImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSitesConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.VpnSitesImpl; +import com.azure.resourcemanager.network.generated.implementation.WebApplicationFirewallPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.WebCategoriesImpl; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources; +import com.azure.resourcemanager.network.generated.models.ApplicationGateways; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroups; +import com.azure.resourcemanager.network.generated.models.AvailableDelegations; +import com.azure.resourcemanager.network.generated.models.AvailableEndpointServices; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypes; +import com.azure.resourcemanager.network.generated.models.AvailableResourceGroupDelegations; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliases; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTags; +import com.azure.resourcemanager.network.generated.models.AzureFirewalls; +import com.azure.resourcemanager.network.generated.models.BastionHosts; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunities; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitors; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixes; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicies; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlans; +import com.azure.resourcemanager.network.generated.models.DefaultSecurityRules; +import com.azure.resourcemanager.network.generated.models.DscpConfigurations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorizations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeerings; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuits; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeerings; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateways; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinks; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizations; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders; +import com.azure.resourcemanager.network.generated.models.FirewallPolicies; +import com.azure.resourcemanager.network.generated.models.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.NatGateways; +import com.azure.resourcemanager.network.generated.models.NatRules; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurations; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancers; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurations; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaces; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; +import com.azure.resourcemanager.network.generated.models.NetworkWatchers; +import com.azure.resourcemanager.network.generated.models.Operations; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateways; +import com.azure.resourcemanager.network.generated.models.PacketCaptures; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoints; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServices; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks; +import com.azure.resourcemanager.network.generated.models.ResourceProviders; +import com.azure.resourcemanager.network.generated.models.RouteFilterRules; +import com.azure.resourcemanager.network.generated.models.RouteFilters; +import com.azure.resourcemanager.network.generated.models.RouteTables; +import com.azure.resourcemanager.network.generated.models.Routes; +import com.azure.resourcemanager.network.generated.models.RoutingIntents; +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.Subnets; +import com.azure.resourcemanager.network.generated.models.Usages; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSites; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkus; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; +import com.azure.resourcemanager.network.generated.models.VirtualHubIpConfigurations; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2S; +import com.azure.resourcemanager.network.generated.models.VirtualHubs; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnections; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRules; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateways; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeerings; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTaps; +import com.azure.resourcemanager.network.generated.models.VirtualNetworks; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeerings; +import com.azure.resourcemanager.network.generated.models.VirtualRouters; +import com.azure.resourcemanager.network.generated.models.VirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnConnections; +import com.azure.resourcemanager.network.generated.models.VpnGateways; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurations; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsAssociatedWithVirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinks; +import com.azure.resourcemanager.network.generated.models.VpnSites; +import com.azure.resourcemanager.network.generated.models.VpnSitesConfigurations; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicies; +import com.azure.resourcemanager.network.generated.models.WebCategories; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +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 ApplicationSecurityGroups applicationSecurityGroups; + + private AvailableDelegations availableDelegations; + + private AvailableResourceGroupDelegations availableResourceGroupDelegations; + + private AvailableServiceAliases availableServiceAliases; + + private AzureFirewalls azureFirewalls; + + private AzureFirewallFqdnTags azureFirewallFqdnTags; + + private WebCategories webCategories; + + private BastionHosts bastionHosts; + + private ResourceProviders resourceProviders; + + private NetworkInterfaces networkInterfaces; + + private PublicIpAddresses publicIpAddresses; + + private CustomIpPrefixes customIpPrefixes; + + private DdosCustomPolicies ddosCustomPolicies; + + private DdosProtectionPlans ddosProtectionPlans; + + private DscpConfigurations dscpConfigurations; + + private AvailableEndpointServices availableEndpointServices; + + private ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations; + + private ExpressRouteCircuitPeerings expressRouteCircuitPeerings; + + private ExpressRouteCircuitConnections expressRouteCircuitConnections; + + private PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections; + + private ExpressRouteCircuits expressRouteCircuits; + + private ExpressRouteServiceProviders expressRouteServiceProviders; + + private ExpressRouteCrossConnections expressRouteCrossConnections; + + private ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings; + + private ExpressRoutePortsLocations expressRoutePortsLocations; + + private ExpressRoutePorts expressRoutePorts; + + private ExpressRouteLinks expressRouteLinks; + + private ExpressRoutePortAuthorizations expressRoutePortAuthorizations; + + 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 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 VirtualHubs virtualHubs; + + private HubVirtualNetworkConnections hubVirtualNetworkConnections; + + private VpnGateways vpnGateways; + + private VpnLinkConnections vpnLinkConnections; + + private VpnConnections vpnConnections; + + private VpnSiteLinkConnections vpnSiteLinkConnections; + + private NatRules natRules; + + private P2SVpnGateways p2SVpnGateways; + + private VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans; + + private VirtualHubRouteTableV2S virtualHubRouteTableV2S; + + private ExpressRouteGateways expressRouteGateways; + + private ExpressRouteConnections expressRouteConnections; + + private VirtualHubBgpConnections virtualHubBgpConnections; + + private VirtualHubIpConfigurations virtualHubIpConfigurations; + + private HubRouteTables hubRouteTables; + + private 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); + } + + /** + * Gets a Configurable instance that can be used to create NetworkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NetworkManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Network service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Network service API instance. + */ + public NetworkManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.network.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + 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); + } + } + + /** @return Resource collection API of ApplicationGateways. */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(clientObject.getApplicationGateways(), this); + } + return applicationGateways; + } + + /** @return Resource collection API of ApplicationGatewayPrivateLinkResources. */ + public ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources() { + if (this.applicationGatewayPrivateLinkResources == null) { + this.applicationGatewayPrivateLinkResources = + new ApplicationGatewayPrivateLinkResourcesImpl( + clientObject.getApplicationGatewayPrivateLinkResources(), this); + } + return applicationGatewayPrivateLinkResources; + } + + /** @return Resource collection API of ApplicationGatewayPrivateEndpointConnections. */ + public ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections() { + if (this.applicationGatewayPrivateEndpointConnections == null) { + this.applicationGatewayPrivateEndpointConnections = + new ApplicationGatewayPrivateEndpointConnectionsImpl( + clientObject.getApplicationGatewayPrivateEndpointConnections(), this); + } + return applicationGatewayPrivateEndpointConnections; + } + + /** @return Resource collection API of ApplicationSecurityGroups. */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups = + new ApplicationSecurityGroupsImpl(clientObject.getApplicationSecurityGroups(), this); + } + return applicationSecurityGroups; + } + + /** @return Resource collection API of AvailableDelegations. */ + public AvailableDelegations availableDelegations() { + if (this.availableDelegations == null) { + this.availableDelegations = new AvailableDelegationsImpl(clientObject.getAvailableDelegations(), this); + } + return availableDelegations; + } + + /** @return Resource collection API of AvailableResourceGroupDelegations. */ + public AvailableResourceGroupDelegations availableResourceGroupDelegations() { + if (this.availableResourceGroupDelegations == null) { + this.availableResourceGroupDelegations = + new AvailableResourceGroupDelegationsImpl(clientObject.getAvailableResourceGroupDelegations(), this); + } + return availableResourceGroupDelegations; + } + + /** @return Resource collection API of AvailableServiceAliases. */ + public AvailableServiceAliases availableServiceAliases() { + if (this.availableServiceAliases == null) { + this.availableServiceAliases = + new AvailableServiceAliasesImpl(clientObject.getAvailableServiceAliases(), this); + } + return availableServiceAliases; + } + + /** @return Resource collection API of AzureFirewalls. */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(clientObject.getAzureFirewalls(), this); + } + return azureFirewalls; + } + + /** @return Resource collection API of AzureFirewallFqdnTags. */ + public AzureFirewallFqdnTags azureFirewallFqdnTags() { + if (this.azureFirewallFqdnTags == null) { + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(clientObject.getAzureFirewallFqdnTags(), this); + } + return azureFirewallFqdnTags; + } + + /** @return Resource collection API of WebCategories. */ + public WebCategories webCategories() { + if (this.webCategories == null) { + this.webCategories = new WebCategoriesImpl(clientObject.getWebCategories(), this); + } + return webCategories; + } + + /** @return Resource collection API of BastionHosts. */ + public BastionHosts bastionHosts() { + if (this.bastionHosts == null) { + this.bastionHosts = new BastionHostsImpl(clientObject.getBastionHosts(), this); + } + return bastionHosts; + } + + /** @return Resource collection API of ResourceProviders. */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** @return Resource collection API of NetworkInterfaces. */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(clientObject.getNetworkInterfaces(), this); + } + return networkInterfaces; + } + + /** @return Resource collection API of PublicIpAddresses. */ + public PublicIpAddresses publicIpAddresses() { + if (this.publicIpAddresses == null) { + this.publicIpAddresses = new PublicIpAddressesImpl(clientObject.getPublicIpAddresses(), this); + } + return publicIpAddresses; + } + + /** @return Resource collection API of CustomIpPrefixes. */ + public CustomIpPrefixes customIpPrefixes() { + if (this.customIpPrefixes == null) { + this.customIpPrefixes = new CustomIpPrefixesImpl(clientObject.getCustomIpPrefixes(), this); + } + return customIpPrefixes; + } + + /** @return Resource collection API of DdosCustomPolicies. */ + public DdosCustomPolicies ddosCustomPolicies() { + if (this.ddosCustomPolicies == null) { + this.ddosCustomPolicies = new DdosCustomPoliciesImpl(clientObject.getDdosCustomPolicies(), this); + } + return ddosCustomPolicies; + } + + /** @return Resource collection API of DdosProtectionPlans. */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(clientObject.getDdosProtectionPlans(), this); + } + return ddosProtectionPlans; + } + + /** @return Resource collection API of DscpConfigurations. */ + public DscpConfigurations dscpConfigurations() { + if (this.dscpConfigurations == null) { + this.dscpConfigurations = new DscpConfigurationsImpl(clientObject.getDscpConfigurations(), this); + } + return dscpConfigurations; + } + + /** @return Resource collection API of AvailableEndpointServices. */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices = + new AvailableEndpointServicesImpl(clientObject.getAvailableEndpointServices(), this); + } + return availableEndpointServices; + } + + /** @return Resource collection API of ExpressRouteCircuitAuthorizations. */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations = + new ExpressRouteCircuitAuthorizationsImpl(clientObject.getExpressRouteCircuitAuthorizations(), this); + } + return expressRouteCircuitAuthorizations; + } + + /** @return Resource collection API of ExpressRouteCircuitPeerings. */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings = + new ExpressRouteCircuitPeeringsImpl(clientObject.getExpressRouteCircuitPeerings(), this); + } + return expressRouteCircuitPeerings; + } + + /** @return Resource collection API of ExpressRouteCircuitConnections. */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections = + new ExpressRouteCircuitConnectionsImpl(clientObject.getExpressRouteCircuitConnections(), this); + } + return expressRouteCircuitConnections; + } + + /** @return Resource collection API of PeerExpressRouteCircuitConnections. */ + public PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections() { + if (this.peerExpressRouteCircuitConnections == null) { + this.peerExpressRouteCircuitConnections = + new PeerExpressRouteCircuitConnectionsImpl(clientObject.getPeerExpressRouteCircuitConnections(), this); + } + return peerExpressRouteCircuitConnections; + } + + /** @return Resource collection API of ExpressRouteCircuits. */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(clientObject.getExpressRouteCircuits(), this); + } + return expressRouteCircuits; + } + + /** @return Resource collection API of ExpressRouteServiceProviders. */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders = + new ExpressRouteServiceProvidersImpl(clientObject.getExpressRouteServiceProviders(), this); + } + return expressRouteServiceProviders; + } + + /** @return Resource collection API of ExpressRouteCrossConnections. */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections = + new ExpressRouteCrossConnectionsImpl(clientObject.getExpressRouteCrossConnections(), this); + } + return expressRouteCrossConnections; + } + + /** @return Resource collection API of ExpressRouteCrossConnectionPeerings. */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = + new ExpressRouteCrossConnectionPeeringsImpl( + clientObject.getExpressRouteCrossConnectionPeerings(), this); + } + return expressRouteCrossConnectionPeerings; + } + + /** @return Resource collection API of ExpressRoutePortsLocations. */ + public ExpressRoutePortsLocations expressRoutePortsLocations() { + if (this.expressRoutePortsLocations == null) { + this.expressRoutePortsLocations = + new ExpressRoutePortsLocationsImpl(clientObject.getExpressRoutePortsLocations(), this); + } + return expressRoutePortsLocations; + } + + /** @return Resource collection API of ExpressRoutePorts. */ + public ExpressRoutePorts expressRoutePorts() { + if (this.expressRoutePorts == null) { + this.expressRoutePorts = new ExpressRoutePortsImpl(clientObject.getExpressRoutePorts(), this); + } + return expressRoutePorts; + } + + /** @return Resource collection API of ExpressRouteLinks. */ + public ExpressRouteLinks expressRouteLinks() { + if (this.expressRouteLinks == null) { + this.expressRouteLinks = new ExpressRouteLinksImpl(clientObject.getExpressRouteLinks(), this); + } + return expressRouteLinks; + } + + /** @return Resource collection API of ExpressRoutePortAuthorizations. */ + public ExpressRoutePortAuthorizations expressRoutePortAuthorizations() { + if (this.expressRoutePortAuthorizations == null) { + this.expressRoutePortAuthorizations = + new ExpressRoutePortAuthorizationsImpl(clientObject.getExpressRoutePortAuthorizations(), this); + } + return expressRoutePortAuthorizations; + } + + /** @return Resource collection API of FirewallPolicies. */ + public FirewallPolicies firewallPolicies() { + if (this.firewallPolicies == null) { + this.firewallPolicies = new FirewallPoliciesImpl(clientObject.getFirewallPolicies(), this); + } + return firewallPolicies; + } + + /** @return Resource collection API of FirewallPolicyRuleCollectionGroups. */ + public FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups() { + if (this.firewallPolicyRuleCollectionGroups == null) { + this.firewallPolicyRuleCollectionGroups = + new FirewallPolicyRuleCollectionGroupsImpl(clientObject.getFirewallPolicyRuleCollectionGroups(), this); + } + return firewallPolicyRuleCollectionGroups; + } + + /** @return Resource collection API of FirewallPolicyIdpsSignatures. */ + public FirewallPolicyIdpsSignatures firewallPolicyIdpsSignatures() { + if (this.firewallPolicyIdpsSignatures == null) { + this.firewallPolicyIdpsSignatures = + new FirewallPolicyIdpsSignaturesImpl(clientObject.getFirewallPolicyIdpsSignatures(), this); + } + return firewallPolicyIdpsSignatures; + } + + /** @return Resource collection API of FirewallPolicyIdpsSignaturesOverrides. */ + public FirewallPolicyIdpsSignaturesOverrides firewallPolicyIdpsSignaturesOverrides() { + if (this.firewallPolicyIdpsSignaturesOverrides == null) { + this.firewallPolicyIdpsSignaturesOverrides = + new FirewallPolicyIdpsSignaturesOverridesImpl( + clientObject.getFirewallPolicyIdpsSignaturesOverrides(), this); + } + return firewallPolicyIdpsSignaturesOverrides; + } + + /** @return Resource collection API of FirewallPolicyIdpsSignaturesFilterValues. */ + public FirewallPolicyIdpsSignaturesFilterValues firewallPolicyIdpsSignaturesFilterValues() { + if (this.firewallPolicyIdpsSignaturesFilterValues == null) { + this.firewallPolicyIdpsSignaturesFilterValues = + new FirewallPolicyIdpsSignaturesFilterValuesImpl( + clientObject.getFirewallPolicyIdpsSignaturesFilterValues(), this); + } + return firewallPolicyIdpsSignaturesFilterValues; + } + + /** @return Resource collection API of IpAllocations. */ + public IpAllocations ipAllocations() { + if (this.ipAllocations == null) { + this.ipAllocations = new IpAllocationsImpl(clientObject.getIpAllocations(), this); + } + return ipAllocations; + } + + /** @return Resource collection API of IpGroups. */ + public IpGroups ipGroups() { + if (this.ipGroups == null) { + this.ipGroups = new IpGroupsImpl(clientObject.getIpGroups(), this); + } + return ipGroups; + } + + /** @return Resource collection API of LoadBalancers. */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(clientObject.getLoadBalancers(), this); + } + return loadBalancers; + } + + /** @return Resource collection API of LoadBalancerBackendAddressPools. */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools = + new LoadBalancerBackendAddressPoolsImpl(clientObject.getLoadBalancerBackendAddressPools(), this); + } + return loadBalancerBackendAddressPools; + } + + /** @return Resource collection API of LoadBalancerFrontendIpConfigurations. */ + public LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations() { + if (this.loadBalancerFrontendIpConfigurations == null) { + this.loadBalancerFrontendIpConfigurations = + new LoadBalancerFrontendIpConfigurationsImpl( + clientObject.getLoadBalancerFrontendIpConfigurations(), this); + } + return loadBalancerFrontendIpConfigurations; + } + + /** @return Resource collection API of InboundNatRules. */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(clientObject.getInboundNatRules(), this); + } + return inboundNatRules; + } + + /** @return Resource collection API of LoadBalancerLoadBalancingRules. */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules = + new LoadBalancerLoadBalancingRulesImpl(clientObject.getLoadBalancerLoadBalancingRules(), this); + } + return loadBalancerLoadBalancingRules; + } + + /** @return Resource collection API of LoadBalancerOutboundRules. */ + public LoadBalancerOutboundRules loadBalancerOutboundRules() { + if (this.loadBalancerOutboundRules == null) { + this.loadBalancerOutboundRules = + new LoadBalancerOutboundRulesImpl(clientObject.getLoadBalancerOutboundRules(), this); + } + return loadBalancerOutboundRules; + } + + /** @return Resource collection API of LoadBalancerNetworkInterfaces. */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces = + new LoadBalancerNetworkInterfacesImpl(clientObject.getLoadBalancerNetworkInterfaces(), this); + } + return loadBalancerNetworkInterfaces; + } + + /** @return Resource collection API of LoadBalancerProbes. */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(clientObject.getLoadBalancerProbes(), this); + } + return loadBalancerProbes; + } + + /** @return Resource collection API of NatGateways. */ + public NatGateways natGateways() { + if (this.natGateways == null) { + this.natGateways = new NatGatewaysImpl(clientObject.getNatGateways(), this); + } + return natGateways; + } + + /** @return Resource collection API of NetworkInterfaceIpConfigurations. */ + public NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations() { + if (this.networkInterfaceIpConfigurations == null) { + this.networkInterfaceIpConfigurations = + new NetworkInterfaceIpConfigurationsImpl(clientObject.getNetworkInterfaceIpConfigurations(), this); + } + return networkInterfaceIpConfigurations; + } + + /** @return Resource collection API of NetworkInterfaceLoadBalancers. */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers = + new NetworkInterfaceLoadBalancersImpl(clientObject.getNetworkInterfaceLoadBalancers(), this); + } + return networkInterfaceLoadBalancers; + } + + /** @return Resource collection API of NetworkInterfaceTapConfigurations. */ + public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() { + if (this.networkInterfaceTapConfigurations == null) { + this.networkInterfaceTapConfigurations = + new NetworkInterfaceTapConfigurationsImpl(clientObject.getNetworkInterfaceTapConfigurations(), this); + } + return networkInterfaceTapConfigurations; + } + + /** @return Resource collection API of NetworkProfiles. */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this); + } + return networkProfiles; + } + + /** @return Resource collection API of NetworkSecurityGroups. */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(clientObject.getNetworkSecurityGroups(), this); + } + return networkSecurityGroups; + } + + /** @return Resource collection API of SecurityRules. */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(clientObject.getSecurityRules(), this); + } + return securityRules; + } + + /** @return Resource collection API of DefaultSecurityRules. */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(clientObject.getDefaultSecurityRules(), this); + } + return defaultSecurityRules; + } + + /** @return Resource collection API of NetworkVirtualAppliances. */ + public NetworkVirtualAppliances networkVirtualAppliances() { + if (this.networkVirtualAppliances == null) { + this.networkVirtualAppliances = + new NetworkVirtualAppliancesImpl(clientObject.getNetworkVirtualAppliances(), this); + } + return networkVirtualAppliances; + } + + /** @return Resource collection API of VirtualApplianceSites. */ + public VirtualApplianceSites virtualApplianceSites() { + if (this.virtualApplianceSites == null) { + this.virtualApplianceSites = new VirtualApplianceSitesImpl(clientObject.getVirtualApplianceSites(), this); + } + return virtualApplianceSites; + } + + /** @return Resource collection API of VirtualApplianceSkus. */ + public VirtualApplianceSkus virtualApplianceSkus() { + if (this.virtualApplianceSkus == null) { + this.virtualApplianceSkus = new VirtualApplianceSkusImpl(clientObject.getVirtualApplianceSkus(), this); + } + return virtualApplianceSkus; + } + + /** @return Resource collection API of InboundSecurityRuleOperations. */ + public InboundSecurityRuleOperations inboundSecurityRuleOperations() { + if (this.inboundSecurityRuleOperations == null) { + this.inboundSecurityRuleOperations = + new InboundSecurityRuleOperationsImpl(clientObject.getInboundSecurityRuleOperations(), this); + } + return inboundSecurityRuleOperations; + } + + /** @return Resource collection API of NetworkWatchers. */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(clientObject.getNetworkWatchers(), this); + } + return networkWatchers; + } + + /** @return Resource collection API of PacketCaptures. */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(clientObject.getPacketCaptures(), this); + } + return packetCaptures; + } + + /** @return Resource collection API of ConnectionMonitors. */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(clientObject.getConnectionMonitors(), this); + } + return connectionMonitors; + } + + /** @return Resource collection API of FlowLogs. */ + public FlowLogs flowLogs() { + if (this.flowLogs == null) { + this.flowLogs = new FlowLogsImpl(clientObject.getFlowLogs(), this); + } + return flowLogs; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of PrivateEndpoints. */ + public PrivateEndpoints privateEndpoints() { + if (this.privateEndpoints == null) { + this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this); + } + return privateEndpoints; + } + + /** @return Resource collection API of AvailablePrivateEndpointTypes. */ + public AvailablePrivateEndpointTypes availablePrivateEndpointTypes() { + if (this.availablePrivateEndpointTypes == null) { + this.availablePrivateEndpointTypes = + new AvailablePrivateEndpointTypesImpl(clientObject.getAvailablePrivateEndpointTypes(), this); + } + return availablePrivateEndpointTypes; + } + + /** @return Resource collection API of PrivateDnsZoneGroups. */ + public PrivateDnsZoneGroups privateDnsZoneGroups() { + if (this.privateDnsZoneGroups == null) { + this.privateDnsZoneGroups = new PrivateDnsZoneGroupsImpl(clientObject.getPrivateDnsZoneGroups(), this); + } + return privateDnsZoneGroups; + } + + /** @return Resource collection API of PrivateLinkServices. */ + public PrivateLinkServices privateLinkServices() { + if (this.privateLinkServices == null) { + this.privateLinkServices = new PrivateLinkServicesImpl(clientObject.getPrivateLinkServices(), this); + } + return privateLinkServices; + } + + /** @return Resource collection API of PublicIpPrefixes. */ + public PublicIpPrefixes publicIpPrefixes() { + if (this.publicIpPrefixes == null) { + this.publicIpPrefixes = new PublicIpPrefixesImpl(clientObject.getPublicIpPrefixes(), this); + } + return publicIpPrefixes; + } + + /** @return Resource collection API of RouteFilters. */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(clientObject.getRouteFilters(), this); + } + return routeFilters; + } + + /** @return Resource collection API of RouteFilterRules. */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(clientObject.getRouteFilterRules(), this); + } + return routeFilterRules; + } + + /** @return Resource collection API of RouteTables. */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(clientObject.getRouteTables(), this); + } + return routeTables; + } + + /** @return Resource collection API of Routes. */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** @return Resource collection API of SecurityPartnerProviders. */ + public SecurityPartnerProviders securityPartnerProviders() { + if (this.securityPartnerProviders == null) { + this.securityPartnerProviders = + new SecurityPartnerProvidersImpl(clientObject.getSecurityPartnerProviders(), this); + } + return securityPartnerProviders; + } + + /** @return Resource collection API of BgpServiceCommunities. */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(clientObject.getBgpServiceCommunities(), this); + } + return bgpServiceCommunities; + } + + /** @return Resource collection API of ServiceEndpointPolicies. */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies = + new ServiceEndpointPoliciesImpl(clientObject.getServiceEndpointPolicies(), this); + } + return serviceEndpointPolicies; + } + + /** @return Resource collection API of ServiceEndpointPolicyDefinitions. */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions = + new ServiceEndpointPolicyDefinitionsImpl(clientObject.getServiceEndpointPolicyDefinitions(), this); + } + return serviceEndpointPolicyDefinitions; + } + + /** @return Resource collection API of ServiceTags. */ + public ServiceTags serviceTags() { + if (this.serviceTags == null) { + this.serviceTags = new ServiceTagsImpl(clientObject.getServiceTags(), this); + } + return serviceTags; + } + + /** @return Resource collection API of ServiceTagInformations. */ + public ServiceTagInformations serviceTagInformations() { + if (this.serviceTagInformations == null) { + this.serviceTagInformations = + new ServiceTagInformationsImpl(clientObject.getServiceTagInformations(), this); + } + return serviceTagInformations; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of VirtualNetworks. */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this); + } + return virtualNetworks; + } + + /** @return Resource collection API of Subnets. */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(clientObject.getSubnets(), this); + } + return subnets; + } + + /** @return Resource collection API of ResourceNavigationLinks. */ + public ResourceNavigationLinks resourceNavigationLinks() { + if (this.resourceNavigationLinks == null) { + this.resourceNavigationLinks = + new ResourceNavigationLinksImpl(clientObject.getResourceNavigationLinks(), this); + } + return resourceNavigationLinks; + } + + /** @return Resource collection API of ServiceAssociationLinks. */ + public ServiceAssociationLinks serviceAssociationLinks() { + if (this.serviceAssociationLinks == null) { + this.serviceAssociationLinks = + new ServiceAssociationLinksImpl(clientObject.getServiceAssociationLinks(), this); + } + return serviceAssociationLinks; + } + + /** @return Resource collection API of VirtualNetworkPeerings. */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings = + new VirtualNetworkPeeringsImpl(clientObject.getVirtualNetworkPeerings(), this); + } + return virtualNetworkPeerings; + } + + /** @return Resource collection API of VirtualNetworkGateways. */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways = + new VirtualNetworkGatewaysImpl(clientObject.getVirtualNetworkGateways(), this); + } + return virtualNetworkGateways; + } + + /** @return Resource collection API of VirtualNetworkGatewayConnections. */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections = + new VirtualNetworkGatewayConnectionsImpl(clientObject.getVirtualNetworkGatewayConnections(), this); + } + return virtualNetworkGatewayConnections; + } + + /** @return Resource collection API of LocalNetworkGateways. */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(clientObject.getLocalNetworkGateways(), this); + } + return localNetworkGateways; + } + + /** @return Resource collection API of VirtualNetworkGatewayNatRules. */ + public VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules() { + if (this.virtualNetworkGatewayNatRules == null) { + this.virtualNetworkGatewayNatRules = + new VirtualNetworkGatewayNatRulesImpl(clientObject.getVirtualNetworkGatewayNatRules(), this); + } + return virtualNetworkGatewayNatRules; + } + + /** @return Resource collection API of VirtualNetworkTaps. */ + public VirtualNetworkTaps virtualNetworkTaps() { + if (this.virtualNetworkTaps == null) { + this.virtualNetworkTaps = new VirtualNetworkTapsImpl(clientObject.getVirtualNetworkTaps(), this); + } + return virtualNetworkTaps; + } + + /** @return Resource collection API of VirtualRouters. */ + public VirtualRouters virtualRouters() { + if (this.virtualRouters == null) { + this.virtualRouters = new VirtualRoutersImpl(clientObject.getVirtualRouters(), this); + } + return virtualRouters; + } + + /** @return Resource collection API of VirtualRouterPeerings. */ + public VirtualRouterPeerings virtualRouterPeerings() { + if (this.virtualRouterPeerings == null) { + this.virtualRouterPeerings = new VirtualRouterPeeringsImpl(clientObject.getVirtualRouterPeerings(), this); + } + return virtualRouterPeerings; + } + + /** @return Resource collection API of VirtualWans. */ + public VirtualWans virtualWans() { + if (this.virtualWans == null) { + this.virtualWans = new VirtualWansImpl(clientObject.getVirtualWans(), this); + } + return virtualWans; + } + + /** @return Resource collection API of VpnSites. */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(clientObject.getVpnSites(), this); + } + return vpnSites; + } + + /** @return Resource collection API of VpnSiteLinks. */ + public VpnSiteLinks vpnSiteLinks() { + if (this.vpnSiteLinks == null) { + this.vpnSiteLinks = new VpnSiteLinksImpl(clientObject.getVpnSiteLinks(), this); + } + return vpnSiteLinks; + } + + /** @return Resource collection API of VpnSitesConfigurations. */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations = + new VpnSitesConfigurationsImpl(clientObject.getVpnSitesConfigurations(), this); + } + return vpnSitesConfigurations; + } + + /** @return Resource collection API of VpnServerConfigurations. */ + public VpnServerConfigurations vpnServerConfigurations() { + if (this.vpnServerConfigurations == null) { + this.vpnServerConfigurations = + new VpnServerConfigurationsImpl(clientObject.getVpnServerConfigurations(), this); + } + return vpnServerConfigurations; + } + + /** @return Resource collection API of VirtualHubs. */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(clientObject.getVirtualHubs(), this); + } + return virtualHubs; + } + + /** @return Resource collection API of HubVirtualNetworkConnections. */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections = + new HubVirtualNetworkConnectionsImpl(clientObject.getHubVirtualNetworkConnections(), this); + } + return hubVirtualNetworkConnections; + } + + /** @return Resource collection API of VpnGateways. */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(clientObject.getVpnGateways(), this); + } + return vpnGateways; + } + + /** @return Resource collection API of VpnLinkConnections. */ + public VpnLinkConnections vpnLinkConnections() { + if (this.vpnLinkConnections == null) { + this.vpnLinkConnections = new VpnLinkConnectionsImpl(clientObject.getVpnLinkConnections(), this); + } + return vpnLinkConnections; + } + + /** @return Resource collection API of VpnConnections. */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(clientObject.getVpnConnections(), this); + } + return vpnConnections; + } + + /** @return Resource collection API of VpnSiteLinkConnections. */ + public VpnSiteLinkConnections vpnSiteLinkConnections() { + if (this.vpnSiteLinkConnections == null) { + this.vpnSiteLinkConnections = + new VpnSiteLinkConnectionsImpl(clientObject.getVpnSiteLinkConnections(), this); + } + return vpnSiteLinkConnections; + } + + /** @return Resource collection API of NatRules. */ + public NatRules natRules() { + if (this.natRules == null) { + this.natRules = new NatRulesImpl(clientObject.getNatRules(), this); + } + return natRules; + } + + /** @return Resource collection API of P2SVpnGateways. */ + public P2SVpnGateways p2SVpnGateways() { + if (this.p2SVpnGateways == null) { + this.p2SVpnGateways = new P2SVpnGatewaysImpl(clientObject.getP2SVpnGateways(), this); + } + return p2SVpnGateways; + } + + /** @return Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. */ + public VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans() { + if (this.vpnServerConfigurationsAssociatedWithVirtualWans == null) { + this.vpnServerConfigurationsAssociatedWithVirtualWans = + new VpnServerConfigurationsAssociatedWithVirtualWansImpl( + clientObject.getVpnServerConfigurationsAssociatedWithVirtualWans(), this); + } + return vpnServerConfigurationsAssociatedWithVirtualWans; + } + + /** @return Resource collection API of VirtualHubRouteTableV2S. */ + public VirtualHubRouteTableV2S virtualHubRouteTableV2S() { + if (this.virtualHubRouteTableV2S == null) { + this.virtualHubRouteTableV2S = + new VirtualHubRouteTableV2SImpl(clientObject.getVirtualHubRouteTableV2S(), this); + } + return virtualHubRouteTableV2S; + } + + /** @return Resource collection API of ExpressRouteGateways. */ + public ExpressRouteGateways expressRouteGateways() { + if (this.expressRouteGateways == null) { + this.expressRouteGateways = new ExpressRouteGatewaysImpl(clientObject.getExpressRouteGateways(), this); + } + return expressRouteGateways; + } + + /** @return Resource collection API of ExpressRouteConnections. */ + public ExpressRouteConnections expressRouteConnections() { + if (this.expressRouteConnections == null) { + this.expressRouteConnections = + new ExpressRouteConnectionsImpl(clientObject.getExpressRouteConnections(), this); + } + return expressRouteConnections; + } + + /** @return Resource collection API of VirtualHubBgpConnections. */ + public VirtualHubBgpConnections virtualHubBgpConnections() { + if (this.virtualHubBgpConnections == null) { + this.virtualHubBgpConnections = + new VirtualHubBgpConnectionsImpl(clientObject.getVirtualHubBgpConnections(), this); + } + return virtualHubBgpConnections; + } + + /** @return Resource collection API of VirtualHubIpConfigurations. */ + public VirtualHubIpConfigurations virtualHubIpConfigurations() { + if (this.virtualHubIpConfigurations == null) { + this.virtualHubIpConfigurations = + new VirtualHubIpConfigurationsImpl(clientObject.getVirtualHubIpConfigurations(), this); + } + return virtualHubIpConfigurations; + } + + /** @return Resource collection API of HubRouteTables. */ + public HubRouteTables hubRouteTables() { + if (this.hubRouteTables == null) { + this.hubRouteTables = new HubRouteTablesImpl(clientObject.getHubRouteTables(), this); + } + return hubRouteTables; + } + + /** @return Resource collection API of RoutingIntents. */ + public RoutingIntents routingIntents() { + if (this.routingIntents == null) { + this.routingIntents = new RoutingIntentsImpl(clientObject.getRoutingIntents(), this); + } + return routingIntents; + } + + /** @return Resource collection API of WebApplicationFirewallPolicies. */ + public WebApplicationFirewallPolicies webApplicationFirewallPolicies() { + if (this.webApplicationFirewallPolicies == null) { + this.webApplicationFirewallPolicies = + new WebApplicationFirewallPoliciesImpl(clientObject.getWebApplicationFirewallPolicies(), this); + } + return webApplicationFirewallPolicies; + } + + /** + * @return Wrapped service client NetworkManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public NetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..9220d2c3d5359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayPrivateEndpointConnectionInner get( + String resourceGroupName, String applicationGatewayName, String connectionName); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..925f2af5cf5c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateLinkResourcesClient. + */ +public interface ApplicationGatewayPrivateLinkResourcesClient { + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java new file mode 100644 index 0000000000000..dd07ef5bcc345 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java @@ -0,0 +1,700 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, TagsObject parameters); + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String applicationGatewayName, TagsObject parameters, Context context); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the application gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context); + + /** + * Lists all available server variables. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableServerVariables(); + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableServerVariablesWithResponse(Context context); + + /** + * Lists all available request headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableRequestHeaders(); + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableRequestHeadersWithResponse(Context context); + + /** + * Lists all available response headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listAvailableResponseHeaders(); + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableResponseHeadersWithResponse(Context context); + + /** + * Lists all available web application firewall rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets(); + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWafRuleSetsWithResponse(Context context); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableSslOptionsWithResponse(Context context); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSslPredefinedPolicies(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.java new file mode 100644 index 0000000000000..a0b6bed55adf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.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.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationSecurityGroupInner updateTags( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters); + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context); + + /** + * Gets all application security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all application security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java new file mode 100644 index 0000000000000..565708b31364b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; + +/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ +public interface AvailableDelegationsClient { + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java new file mode 100644 index 0000000000000..56d342f174f23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; + +/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ +public interface AvailableEndpointServicesClient { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java new file mode 100644 index 0000000000000..7beb6351d958b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */ +public interface AvailablePrivateEndpointTypesClient { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String location, String resourceGroupName); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java new file mode 100644 index 0000000000000..e640f0c35fe35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; + +/** + * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. + */ +public interface AvailableResourceGroupDelegationsClient { + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String resourceGroupName); + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java new file mode 100644 index 0000000000000..ad66184f17029 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; + +/** An instance of this class provides access to all the operations defined in AvailableServiceAliasesClient. */ +public interface AvailableServiceAliasesClient { + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String location); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java new file mode 100644 index 0000000000000..bbae7e0405b3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; + +/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ +public interface AzureFirewallFqdnTagsClient { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java new file mode 100644 index 0000000000000..bf49987108ce9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context); + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java new file mode 100644 index 0000000000000..75cfec2556c98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner getByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all Bastion Hosts in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java new file mode 100644 index 0000000000000..e657a0cb7cc25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; + +/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ +public interface BgpServiceCommunitiesClient { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java new file mode 100644 index 0000000000000..5af04dc6d978f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.java @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectionMonitorsClient. */ +public interface ConnectionMonitorsClient { + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters); + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorResultInner updateTags( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters); + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + TagsObject parameters, + Context context); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java new file mode 100644 index 0000000000000..988dd1be93891 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner getByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context); + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomIpPrefixInner updateTags(String resourceGroupName, String customIpPrefixName, TagsObject parameters); + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String customIpPrefixName, TagsObject parameters, Context context); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java new file mode 100644 index 0000000000000..ab578b3a8deae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters); + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.java new file mode 100644 index 0000000000000..0bee710ee4d08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.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.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters); + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters, Context context); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java new file mode 100644 index 0000000000000..422716c670606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; + +/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ +public interface DefaultSecurityRulesClient { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.java new file mode 100644 index 0000000000000..8e798e73045d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.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.DscpConfigurationInner; +import reactor.core.publisher.Mono; + +/** 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 differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DscpConfigurationInner getByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all dscp configurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all dscp configurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.java new file mode 100644 index 0000000000000..c9e6774f3bd86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.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.ExpressRouteCircuitAuthorizationInner; +import reactor.core.publisher.Mono; + +/** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java new file mode 100644 index 0000000000000..77474f0b403d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.java new file mode 100644 index 0000000000000..6f7120482ded8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.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.ExpressRouteCircuitPeeringInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String circuitName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java new file mode 100644 index 0000000000000..dc309a8cde741 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitsClient.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters); + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String circuitName, TagsObject parameters, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.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 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.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 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.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 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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the express route circuits in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the express route circuits in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java new file mode 100644 index 0000000000000..81bcbf278e9f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.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.Response; +import com.azure.core.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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ +public interface ExpressRouteConnectionsClient { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.java new file mode 100644 index 0000000000000..6047a64c5865f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.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.ExpressRouteCrossConnectionPeeringInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. + */ +public interface ExpressRouteCrossConnectionPeeringsClient { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String crossConnectionName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionPeeringInner get( + String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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..3cd4d1f429243 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient. */ +public interface ExpressRouteCrossConnectionsClient { + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteCrossConnectionInner updateTags( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters); + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.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 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.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 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.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 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.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..dc4d4a2d1d7a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ +public interface ExpressRouteGatewaysClient { + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayListInner listBySubscription(); + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..bc0122367fb47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ +public interface ExpressRouteLinksClient { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink List Result. + */ + @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. + */ + @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..796045264ebe8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortAuthorizationsClient.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.ExpressRoutePortAuthorizationInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..fd811bd81d12f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateExpressRoutePortsLoaResultInner generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.java new file mode 100644 index 0000000000000..b66914c97db25 --- /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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortsLocationInner get(String locationName); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java new file mode 100644 index 0000000000000..5d11a40070010 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; + +/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ +public interface ExpressRouteServiceProvidersClient { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java new file mode 100644 index 0000000000000..840a923da94ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.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.FirewallPolicyInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyInner getByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context); + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/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..809585264cced --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..6878b68e97082 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..4627c5fa6de23 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 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 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); + + /** + * 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); + + /** + * 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 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 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); + + /** + * 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); +} 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..cfaba46ba014d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.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.FirewallPolicyRuleCollectionGroupInner; +import reactor.core.publisher.Mono; + +/** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyRuleCollectionGroupInner get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String firewallPolicyName); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java new file mode 100644 index 0000000000000..4dc3ca6cd5dae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.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.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FlowLogsClient. */ +public interface FlowLogsClient { + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner updateTags( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters); + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + TagsObject parameters, + Context context); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowLogInner get(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.java new file mode 100644 index 0000000000000..42923c5ea07b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.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.HubRouteTableInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HubRouteTablesClient. */ +public interface HubRouteTablesClient { + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubRouteTableInner get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.java new file mode 100644 index 0000000000000..d4c65a88f2dc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.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.HubVirtualNetworkConnectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HubVirtualNetworkConnectionsClient. */ +public interface HubVirtualNetworkConnectionsClient { + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubVirtualNetworkConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java new file mode 100644 index 0000000000000..b6aa484e41add --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ +public interface InboundNatRulesClient { + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context); + + /** + * Creates or updates a load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound NAT rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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..73aaa4b8268b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in InboundSecurityRuleOperationsClient. */ +public interface InboundSecurityRuleOperationsClient { + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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..80b6de5259687 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.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.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner getByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context); + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAllocationInner updateTags(String resourceGroupName, String ipAllocationName, TagsObject parameters); + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String ipAllocationName, TagsObject parameters, Context context); + + /** + * Gets all IpAllocations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all IpAllocations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java new file mode 100644 index 0000000000000..cd5cf81d48c9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.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; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpGroupsClient. */ +public interface IpGroupsClient { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner getByResourceGroup(String resourceGroupName, String ipGroupsName); + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context); + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @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 IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpGroupInner updateGroups(String resourceGroupName, String ipGroupsName, TagsObject parameters); + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateGroupsWithResponse( + String resourceGroupName, String ipGroupsName, TagsObject parameters, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all IpGroups in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.java new file mode 100644 index 0000000000000..3a1bf0cab397a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.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.BackendAddressPoolInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ +public interface LoadBalancerBackendAddressPoolsClient { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressPoolInner get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @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 pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..6e2c612fae9d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerFrontendIpConfigurationsClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in + * LoadBalancerFrontendIpConfigurationsClient. + */ +public interface LoadBalancerFrontendIpConfigurationsClient { + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FrontendIpConfigurationInner get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java new file mode 100644 index 0000000000000..7ca8e3e7274a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ +public interface LoadBalancerLoadBalancingRulesClient { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java new file mode 100644 index 0000000000000..1b4f255d39601 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ +public interface LoadBalancerNetworkInterfacesClient { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java new file mode 100644 index 0000000000000..fd5ccc247d21c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ +public interface LoadBalancerOutboundRulesClient { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java new file mode 100644 index 0000000000000..5938d9ba7acd0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; + +/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ +public interface LoadBalancerProbesClient { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java new file mode 100644 index 0000000000000..7d6bc98060d4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context); + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters); + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String loadBalancerName, TagsObject parameters, Context context); + + /** + * Gets all the load balancers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the load balancers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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..2d466811963ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.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.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ +public interface LocalNetworkGatewaysClient { + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalNetworkGatewayInner updateTags( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters); + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters, Context context); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.java new file mode 100644 index 0000000000000..d685e2ee8a9bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.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.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context); + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, TagsObject parameters); + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String natGatewayName, TagsObject parameters, Context context); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java new file mode 100644 index 0000000000000..994b4fcbe9b2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NatRulesClient. */ +public interface NatRulesClient { + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayNatRuleInner get(String resourceGroupName, String gatewayName, String natRuleName); + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context); + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java new file mode 100644 index 0000000000000..c53022241760a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceIpConfigurationsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. + */ +public interface NetworkInterfaceIpConfigurationsClient { + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceIpConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java new file mode 100644 index 0000000000000..b7363b507f0db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; + +/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ +public interface NetworkInterfaceLoadBalancersClient { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.java new file mode 100644 index 0000000000000..d1202b34b6ec0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.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.NetworkInterfaceTapConfigurationInner; +import reactor.core.publisher.Mono; + +/** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceTapConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java new file mode 100644 index 0000000000000..0554f2d8b825c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ +public interface NetworkInterfacesClient { + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName); + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context); + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, TagsObject parameters); + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context); + + /** + * Gets all network interfaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network interfaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set 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 ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java new file mode 100644 index 0000000000000..b27151e620f7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java @@ -0,0 +1,831 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for NetworkManagementClient class. */ +public interface NetworkManagementClient { + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ApplicationGatewaysClient object to access its operations. + * + * @return the ApplicationGatewaysClient object. + */ + ApplicationGatewaysClient getApplicationGateways(); + + /** + * Gets the ApplicationGatewayPrivateLinkResourcesClient object to access its operations. + * + * @return the ApplicationGatewayPrivateLinkResourcesClient object. + */ + ApplicationGatewayPrivateLinkResourcesClient getApplicationGatewayPrivateLinkResources(); + + /** + * Gets the ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ApplicationGatewayPrivateEndpointConnectionsClient object. + */ + ApplicationGatewayPrivateEndpointConnectionsClient getApplicationGatewayPrivateEndpointConnections(); + + /** + * Gets the ApplicationSecurityGroupsClient object to access its operations. + * + * @return the ApplicationSecurityGroupsClient object. + */ + ApplicationSecurityGroupsClient getApplicationSecurityGroups(); + + /** + * Gets the AvailableDelegationsClient object to access its operations. + * + * @return the AvailableDelegationsClient object. + */ + AvailableDelegationsClient getAvailableDelegations(); + + /** + * Gets the AvailableResourceGroupDelegationsClient object to access its operations. + * + * @return the AvailableResourceGroupDelegationsClient object. + */ + AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations(); + + /** + * Gets the AvailableServiceAliasesClient object to access its operations. + * + * @return the AvailableServiceAliasesClient object. + */ + AvailableServiceAliasesClient getAvailableServiceAliases(); + + /** + * Gets the AzureFirewallsClient object to access its operations. + * + * @return the AzureFirewallsClient object. + */ + AzureFirewallsClient getAzureFirewalls(); + + /** + * Gets the AzureFirewallFqdnTagsClient object to access its operations. + * + * @return the AzureFirewallFqdnTagsClient object. + */ + AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags(); + + /** + * Gets the WebCategoriesClient object to access its operations. + * + * @return the WebCategoriesClient object. + */ + WebCategoriesClient getWebCategories(); + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + BastionHostsClient getBastionHosts(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + NetworkInterfacesClient getNetworkInterfaces(); + + /** + * Gets the PublicIpAddressesClient object to access its operations. + * + * @return the PublicIpAddressesClient object. + */ + PublicIpAddressesClient getPublicIpAddresses(); + + /** + * Gets the CustomIpPrefixesClient object to access its operations. + * + * @return the CustomIpPrefixesClient object. + */ + CustomIpPrefixesClient getCustomIpPrefixes(); + + /** + * Gets the DdosCustomPoliciesClient object to access its operations. + * + * @return the DdosCustomPoliciesClient object. + */ + DdosCustomPoliciesClient getDdosCustomPolicies(); + + /** + * Gets the DdosProtectionPlansClient object to access its operations. + * + * @return the DdosProtectionPlansClient object. + */ + DdosProtectionPlansClient getDdosProtectionPlans(); + + /** + * Gets the DscpConfigurationsClient object to access its operations. + * + * @return the DscpConfigurationsClient object. + */ + DscpConfigurationsClient getDscpConfigurations(); + + /** + * Gets the AvailableEndpointServicesClient object to access its operations. + * + * @return the AvailableEndpointServicesClient object. + */ + AvailableEndpointServicesClient getAvailableEndpointServices(); + + /** + * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. + * + * @return the ExpressRouteCircuitAuthorizationsClient object. + */ + ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations(); + + /** + * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. + * + * @return the ExpressRouteCircuitPeeringsClient object. + */ + ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings(); + + /** + * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the ExpressRouteCircuitConnectionsClient object. + */ + ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections(); + + /** + * Gets the PeerExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the PeerExpressRouteCircuitConnectionsClient object. + */ + PeerExpressRouteCircuitConnectionsClient getPeerExpressRouteCircuitConnections(); + + /** + * Gets the ExpressRouteCircuitsClient object to access its operations. + * + * @return the ExpressRouteCircuitsClient object. + */ + ExpressRouteCircuitsClient getExpressRouteCircuits(); + + /** + * Gets the ExpressRouteServiceProvidersClient object to access its operations. + * + * @return the ExpressRouteServiceProvidersClient object. + */ + ExpressRouteServiceProvidersClient getExpressRouteServiceProviders(); + + /** + * Gets the ExpressRouteCrossConnectionsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionsClient object. + */ + ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections(); + + /** + * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionPeeringsClient object. + */ + ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings(); + + /** + * Gets the ExpressRoutePortsLocationsClient object to access its operations. + * + * @return the ExpressRoutePortsLocationsClient object. + */ + ExpressRoutePortsLocationsClient getExpressRoutePortsLocations(); + + /** + * Gets the ExpressRoutePortsClient object to access its operations. + * + * @return the ExpressRoutePortsClient object. + */ + ExpressRoutePortsClient getExpressRoutePorts(); + + /** + * Gets the ExpressRouteLinksClient object to access its operations. + * + * @return the ExpressRouteLinksClient object. + */ + ExpressRouteLinksClient getExpressRouteLinks(); + + /** + * Gets the ExpressRoutePortAuthorizationsClient object to access its operations. + * + * @return the ExpressRoutePortAuthorizationsClient object. + */ + ExpressRoutePortAuthorizationsClient getExpressRoutePortAuthorizations(); + + /** + * 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 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 VirtualHubsClient object to access its operations. + * + * @return the VirtualHubsClient object. + */ + VirtualHubsClient getVirtualHubs(); + + /** + * Gets the HubVirtualNetworkConnectionsClient object to access its operations. + * + * @return the HubVirtualNetworkConnectionsClient object. + */ + HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections(); + + /** + * Gets the VpnGatewaysClient object to access its operations. + * + * @return the VpnGatewaysClient object. + */ + VpnGatewaysClient getVpnGateways(); + + /** + * Gets the VpnLinkConnectionsClient object to access its operations. + * + * @return the VpnLinkConnectionsClient object. + */ + VpnLinkConnectionsClient getVpnLinkConnections(); + + /** + * Gets the VpnConnectionsClient object to access its operations. + * + * @return the VpnConnectionsClient object. + */ + VpnConnectionsClient getVpnConnections(); + + /** + * Gets the VpnSiteLinkConnectionsClient object to access its operations. + * + * @return the VpnSiteLinkConnectionsClient object. + */ + VpnSiteLinkConnectionsClient getVpnSiteLinkConnections(); + + /** + * Gets the NatRulesClient object to access its operations. + * + * @return the NatRulesClient object. + */ + NatRulesClient getNatRules(); + + /** + * Gets the P2SVpnGatewaysClient object to access its operations. + * + * @return the P2SVpnGatewaysClient object. + */ + P2SVpnGatewaysClient getP2SVpnGateways(); + + /** + * Gets the VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. + * + * @return the VpnServerConfigurationsAssociatedWithVirtualWansClient object. + */ + VpnServerConfigurationsAssociatedWithVirtualWansClient getVpnServerConfigurationsAssociatedWithVirtualWans(); + + /** + * Gets the VirtualHubRouteTableV2SClient object to access its operations. + * + * @return the VirtualHubRouteTableV2SClient object. + */ + VirtualHubRouteTableV2SClient getVirtualHubRouteTableV2S(); + + /** + * Gets the ExpressRouteGatewaysClient object to access its operations. + * + * @return the ExpressRouteGatewaysClient object. + */ + ExpressRouteGatewaysClient getExpressRouteGateways(); + + /** + * Gets the ExpressRouteConnectionsClient object to access its operations. + * + * @return the ExpressRouteConnectionsClient object. + */ + ExpressRouteConnectionsClient getExpressRouteConnections(); + + /** + * Gets the VirtualHubBgpConnectionsClient object to access its operations. + * + * @return the VirtualHubBgpConnectionsClient object. + */ + VirtualHubBgpConnectionsClient getVirtualHubBgpConnections(); + + /** + * Gets the VirtualHubIpConfigurationsClient object to access its operations. + * + * @return the VirtualHubIpConfigurationsClient object. + */ + VirtualHubIpConfigurationsClient getVirtualHubIpConfigurations(); + + /** + * Gets the HubRouteTablesClient object to access its operations. + * + * @return the HubRouteTablesClient object. + */ + HubRouteTablesClient getHubRouteTables(); + + /** + * Gets the 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/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..e112ff7792b4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.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.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context); + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner createOrUpdate( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters); + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters, Context context); + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters); + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkProfileName, TagsObject parameters, Context context); + + /** + * Gets all the network profiles in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the network profiles in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.java new file mode 100644 index 0000000000000..b7e112a773dcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.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.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context); + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityGroupInner updateTags( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters); + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters, Context context); + + /** + * Gets all network security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.java new file mode 100644 index 0000000000000..0867fa8171967 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.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.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context); + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInner updateTags( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters); + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters, Context context); + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java new file mode 100644 index 0000000000000..2b6dc21fdfe7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java @@ -0,0 +1,1008 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkWatchersClient. */ +public interface NetworkWatchersClient { + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner createOrUpdate( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters); + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters, Context context); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters); + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String networkWatcherName, TagsObject parameters, Context context); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all network watchers by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all network watchers by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TopologyInner getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @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 next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @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 configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 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.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 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.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..093573e276aa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Network Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Network Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java new file mode 100644 index 0000000000000..ee841c2a02469 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in P2SVpnGatewaysClient. */ +public interface P2SVpnGatewaysClient { + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 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.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 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.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 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.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 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.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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..0d19b82684149 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ +public interface PacketCapturesClient { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @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 status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.java new file mode 100644 index 0000000000000..78e5e24a7d5eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in PeerExpressRouteCircuitConnectionsClient. + */ +public interface PeerExpressRouteCircuitConnectionsClient { + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeerExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.java new file mode 100644 index 0000000000000..7cb9ddfb343f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.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.PrivateDnsZoneGroupInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateDnsZoneGroupInner get(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String privateEndpointName, String resourceGroupName); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String privateEndpointName, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java new file mode 100644 index 0000000000000..885ea0c3b9348 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointInner getByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context); + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private endpoints in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java new file mode 100644 index 0000000000000..831508e10d841 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateLinkServicesClient.java @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context); + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private link service in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServices(String location); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java new file mode 100644 index 0000000000000..ceef3e50bdeeb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublicIpAddressesClient. */ +public interface PublicIpAddressesClient { + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName); + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service 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); + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context); + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner updateTags(String resourceGroupName, String publicIpAddressName, TagsObject parameters); + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String publicIpAddressName, TagsObject parameters, Context context); + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the public IP addresses in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set 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); +} 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..bac0d740bf862 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context); + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters); + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String publicIpPrefixName, TagsObject parameters, Context context); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java new file mode 100644 index 0000000000000..dfde7cb8437d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ResourceNavigationLinksClient. */ +public interface ResourceNavigationLinksClient { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceNavigationLinksListResultInner list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..04fd4ab46034e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, String virtualWanName); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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..bf3771306a518 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.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.RouteFilterRuleInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.java new file mode 100644 index 0000000000000..05bfffa07b2c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.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.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context); + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteFilterInner updateTags(String resourceGroupName, String routeFilterName, TagsObject parameters); + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String routeFilterName, TagsObject parameters, Context context); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route filters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all route filters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.java new file mode 100644 index 0000000000000..4b4d244000ad9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.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.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context); + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters); + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String routeTableName, TagsObject parameters, Context context); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all route tables in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java new file mode 100644 index 0000000000000..e99f3ebafaa19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.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; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteInner get(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String routeTableName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String routeTableName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/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..12e98fb39276e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingIntentsClient.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.RoutingIntentInner; +import reactor.core.publisher.Mono; + +/** 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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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/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..156e526686bac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.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.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner getByResourceGroup(String resourceGroupName, String securityPartnerProviderName); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityPartnerProviderInner updateTags( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters); + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters, Context context); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.java new file mode 100644 index 0000000000000..44ed43480d000 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.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.SecurityRuleInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @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 network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java new file mode 100644 index 0000000000000..27745e2cd6cc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceAssociationLinksClient. */ +public interface ServiceAssociationLinksClient { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceAssociationLinksListResultInner list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.java new file mode 100644 index 0000000000000..25c48dd39b505 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.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.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context); + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyInner updateTags( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters); + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters, Context context); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java new file mode 100644 index 0000000000000..c34c2980634f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceEndpointPolicyDefinitionInner get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/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..ab6befc9fc3cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagInformationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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. + */ + @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. + */ + @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..ce71b308dfe6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; + +/** An instance of this class provides access to all the operations defined in ServiceTagsClient. */ +public interface ServiceTagsClient { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceTagsListResultInner list(String location); + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java new file mode 100644 index 0000000000000..2deda875761b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.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.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context); + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java new file mode 100644 index 0000000000000..43455958e8a5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.java new file mode 100644 index 0000000000000..3640efe03a068 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.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.VirtualApplianceSiteInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualApplianceSiteInner get(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java new file mode 100644 index 0000000000000..715f8a8817560 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSkusClient. */ +public interface VirtualApplianceSkusClient { + /** + * List all SKUs available for a virtual appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceSkuInner get(String skuName); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String skuName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java new file mode 100644 index 0000000000000..2a1f7d8211e35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubBgpConnectionsClient. */ +public interface VirtualHubBgpConnectionsClient { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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..9d1eb05aae8d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.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.HubIpConfigurationInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubIpConfigurationsClient. */ +public interface VirtualHubIpConfigurationsClient { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HubIpConfigurationInner get(String resourceGroupName, String virtualHubName, String ipConfigName); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context); + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java new file mode 100644 index 0000000000000..5bdb6164a3c35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubRouteTableV2SClient. */ +public interface VirtualHubRouteTableV2SClient { + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubRouteTableV2Inner get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java new file mode 100644 index 0000000000000..ee7c232c0cbcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubsClient. */ +public interface VirtualHubsClient { + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context); + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters); + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters, Context context); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java new file mode 100644 index 0000000000000..6980e0c7b6ff0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java @@ -0,0 +1,749 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient. + */ +public interface VirtualNetworkGatewayConnectionsClient { + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayConnectionInner getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..b20776259a585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.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.VirtualNetworkGatewayNatRuleInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewayNatRulesClient. */ +public interface VirtualNetworkGatewayNatRulesClient { + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayNatRuleInner get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName); + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java new file mode 100644 index 0000000000000..1498e108f7d68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java @@ -0,0 +1,1322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewaysClient. */ +public interface VirtualNetworkGatewaysClient { + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.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. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..6f89a86218f33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.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.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters); + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.java new file mode 100644 index 0000000000000..33bc40614e8c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.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.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context); + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters); + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String tapName, TagsObject tapParameters, Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java new file mode 100644 index 0000000000000..dd0904abe5b75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context); + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters); + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualNetworkName, TagsObject parameters, Context context); + + /** + * Gets all virtual networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all virtual networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpAddressAvailabilityResultInner checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.java new file mode 100644 index 0000000000000..a5e26e6de0df0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.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.VirtualRouterPeeringInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterPeeringInner get(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualRouterName); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualRouterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java new file mode 100644 index 0000000000000..d454ebdea926d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.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.VirtualRouterInner; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualRouterInner getByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context); + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.java new file mode 100644 index 0000000000000..246c6ec38cd6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.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.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ +public interface VirtualWansClient { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName); + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters); + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String virtualWanName, TagsObject wanParameters, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.java new file mode 100644 index 0000000000000..c25dfd405d941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.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.fluent; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnConnectionsClient. */ +public interface VpnConnectionsClient { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java new file mode 100644 index 0000000000000..ada991cb1d188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.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; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnGatewaysClient. */ +public interface VpnGatewaysClient { + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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.LONG_RUNNING_OPERATION) + SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java new file mode 100644 index 0000000000000..43435701e83bf --- /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.http.rest.Response; +import com.azure.core.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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.java new file mode 100644 index 0000000000000..a31ee52b03bb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsAssociatedWithVirtualWansClient.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; + +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.VpnServerConfigurationsResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * VpnServerConfigurationsAssociatedWithVirtualWansClient. + */ +public interface VpnServerConfigurationsAssociatedWithVirtualWansClient { + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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..26a2a911b04ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.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; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnServerConfigurationsClient. */ +public interface VpnServerConfigurationsClient { + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context); + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationInner updateTags( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters); + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String vpnServerConfigurationName, + TagsObject vpnServerConfigurationParameters, + Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java new file mode 100644 index 0000000000000..26f1f6df459d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinkConnectionsClient. */ +public interface VpnSiteLinkConnectionsClient { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteLinkConnectionInner get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java new file mode 100644 index 0000000000000..eccfc9a599c03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinksClient. */ +public interface VpnSiteLinksClient { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteLinkInner get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName); + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.java new file mode 100644 index 0000000000000..5d78966b5c8b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.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.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ +public interface VpnSitesClient { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName); + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context); + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters); + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters, Context context); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnSites in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the VpnSites in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java new file mode 100644 index 0000000000000..f827ec55dc9be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.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; +import reactor.core.publisher.Mono; + +/** 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..ce84d3b8e106c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.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; + +import com.azure.core.annotation.ReturnType; +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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebApplicationFirewallPoliciesClient. */ +public interface WebApplicationFirewallPoliciesClient { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the WAF policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the WAF policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters); + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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..b86fc7730c52d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; + +/** An instance of this class provides access to all the operations defined in WebCategoriesClient. */ +public interface WebCategoriesClient { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureWebCategoryInner get(String name); + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String name, String expand, Context context); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..27c9737603dbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificatePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayAuthenticationCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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..2a7b5f1dc45d4 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Response for ApplicationGatewayAvailableSslOptions API service call. */ +@Fluent +public final class ApplicationGatewayAvailableSslOptionsInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslOptionsInner.class); + + /* + * Properties of the application gateway available SSL options. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..26681f244bf91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ApplicationGatewayAvailableSslOptions. */ +@Fluent +public final class ApplicationGatewayAvailableSslOptionsPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslOptionsPropertiesFormat.class); + + /* + * 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; + + /** + * 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..910b3a8e7bcd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableWafRuleSets API service call. */ +@Fluent +public final class ApplicationGatewayAvailableWafRuleSetsResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableWafRuleSetsResultInner.class); + + /* + * The list of application gateway rule sets. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of application gateway rule sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of application gateway rule sets. + * + * @param value the value value to set. + * @return the ApplicationGatewayAvailableWafRuleSetsResultInner object itself. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..241a5949c6e3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.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.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Backend Address Pool of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddressPoolPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddressPoolPropertiesFormat.class); + + /* + * 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; + + /** + * 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..deca8c9a4d5c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayBackendHealth API service call. */ +@Fluent +public final class ApplicationGatewayBackendHealthInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthInner.class); + + /* + * A list of ApplicationGatewayBackendHealthPool resources. + */ + @JsonProperty(value = "backendAddressPools") + private List backendAddressPools; + + /** + * Get the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.backendAddressPools; + } + + /** + * Set the backendAddressPools property: A list of ApplicationGatewayBackendHealthPool resources. + * + * @param backendAddressPools the backendAddressPools value to set. + * @return the ApplicationGatewayBackendHealthInner object itself. + */ + public ApplicationGatewayBackendHealthInner withBackendAddressPools( + List backendAddressPools) { + this.backendAddressPools = backendAddressPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPools() != null) { + backendAddressPools().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java new file mode 100644 index 0000000000000..f8f48868f8df9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of on demand test probe. */ +@Fluent +public final class ApplicationGatewayBackendHealthOnDemandInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthOnDemandInner.class); + + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * Application gateway BackendHealthHttp settings. + */ + @JsonProperty(value = "backendHealthHttpSettings") + private ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings; + + /** + * Get the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayBackendHealthOnDemandInner object itself. + */ + public ApplicationGatewayBackendHealthOnDemandInner withBackendAddressPool( + ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value. + */ + public ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings() { + return this.backendHealthHttpSettings; + } + + /** + * Set the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @param backendHealthHttpSettings the backendHealthHttpSettings value to set. + * @return the ApplicationGatewayBackendHealthOnDemandInner object itself. + */ + public ApplicationGatewayBackendHealthOnDemandInner withBackendHealthHttpSettings( + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings) { + this.backendHealthHttpSettings = backendHealthHttpSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPool() != null) { + backendAddressPool().validate(); + } + if (backendHealthHttpSettings() != null) { + backendHealthHttpSettings().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java new file mode 100644 index 0000000000000..7638cc9419068 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application gateway backendhealth http settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthServerInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthServerInner.class); + + /* + * IP address or FQDN of backend server. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Reference to IP configuration of backend server. + */ + @JsonProperty(value = "ipConfiguration") + private NetworkInterfaceIpConfigurationInner ipConfiguration; + + /* + * Health of backend server. + */ + @JsonProperty(value = "health") + private ApplicationGatewayBackendHealthServerHealth health; + + /* + * Health Probe Log. + */ + @JsonProperty(value = "healthProbeLog") + private String healthProbeLog; + + /** + * Get the address property: IP address or FQDN of backend server. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: IP address or FQDN of backend server. + * + * @param address the address value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the ipConfiguration property: Reference to IP configuration of backend server. + * + * @return the ipConfiguration value. + */ + public NetworkInterfaceIpConfigurationInner ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set the ipConfiguration property: Reference to IP configuration of backend server. + * + * @param ipConfiguration the ipConfiguration value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withIpConfiguration( + NetworkInterfaceIpConfigurationInner ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get the health property: Health of backend server. + * + * @return the health value. + */ + public ApplicationGatewayBackendHealthServerHealth health() { + return this.health; + } + + /** + * Set the health property: Health of backend server. + * + * @param health the health value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withHealth(ApplicationGatewayBackendHealthServerHealth health) { + this.health = health; + return this; + } + + /** + * Get the healthProbeLog property: Health Probe Log. + * + * @return the healthProbeLog value. + */ + public String healthProbeLog() { + return this.healthProbeLog; + } + + /** + * Set the healthProbeLog property: Health Probe Log. + * + * @param healthProbeLog the healthProbeLog value to set. + * @return the ApplicationGatewayBackendHealthServerInner object itself. + */ + public ApplicationGatewayBackendHealthServerInner withHealthProbeLog(String healthProbeLog) { + this.healthProbeLog = healthProbeLog; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfiguration() != null) { + ipConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..5e0ee29be0314 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHttpSettingsPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..a2ab2dccd2b52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the web application firewall rule set. */ +@Fluent +public final class ApplicationGatewayFirewallRuleSetPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleSetPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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()); + } + } +} 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..5b3abfd72d550 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.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.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Frontend IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendIpConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayFrontendIpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..78b7df9e13134 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Frontend port of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendPortPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendPortPropertiesFormat.class); + + /* + * 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; + + /** + * 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..8545bdbcb723e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of HTTP listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayHttpListenerPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayHttpListenerPropertiesFormat.class); + + /* + * 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; + + /** + * 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..573aa3f9299b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java @@ -0,0 +1,932 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.ApplicationGatewayAuthenticationCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAutoscaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +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.ApplicationGatewaySku; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlPathMap; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWebApplicationFirewallConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Application gateway resource. */ +@Fluent +public final class ApplicationGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayInner.class); + + /* + * 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; + + /** + * 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 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 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 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..5d1effbc99204 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayIpConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayIpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..3807f9dfb93b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionAlgorithm; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Load Distribution Policy of an application gateway. */ +@Fluent +public final class ApplicationGatewayLoadDistributionPolicyPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayLoadDistributionPolicyPropertiesFormat.class); + + /* + * 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; + + /** + * 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..de27b6ffdb7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationGatewayLoadDistributionTargetPropertiesFormat model. */ +@Fluent +public final class ApplicationGatewayLoadDistributionTargetPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayLoadDistributionTargetPropertiesFormat.class); + + /* + * 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; + + /** + * 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..62caaf1116922 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of path rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayPathRulePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPathRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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..83d2c7071a865 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private Endpoint connection on an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionInner extends SubResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionInner.class); + + /* + * 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; + + /** + * 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..df83021f42a51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Private Link Resource of an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionPropertiesInner { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayPrivateEndpointConnectionPropertiesInner.class); + + /* + * 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; + + /** + * 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..381ec5f7e3165 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of private link configuration on an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateLinkConfigurationProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkConfigurationProperties.class); + + /* + * 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; + + /** + * 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..1761001084d06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an application gateway private link IP configuration. */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfigurationProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkIpConfigurationProperties.class); + + /* + * 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; + + /** + * 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..ed05463f266f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLink Resource of an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourceInner.class); + + /* + * 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; + + /** + * 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..ad7c1deee1deb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourceProperties.class); + + /* + * 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; + + /** + * 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..864afa4aa6c38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of probe of an application gateway. */ +@Fluent +public final class ApplicationGatewayProbePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbePropertiesFormat.class); + + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * ://:. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The 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; + + /* + * 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; + + /** + * 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 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..8e1479dcde385 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.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.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.ApplicationGatewayAuthenticationCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAutoscaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the application gateway. */ +@Fluent +public final class ApplicationGatewayPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPropertiesFormat.class); + + /* + * 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; + + /* + * 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; + + /* + * 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; + + /* + * 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; + + /** + * 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 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 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 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 (httpListeners() != null) { + httpListeners().forEach(e -> e.validate()); + } + if (sslProfiles() != null) { + sslProfiles().forEach(e -> e.validate()); + } + if (urlPathMaps() != null) { + urlPathMaps().forEach(e -> e.validate()); + } + if (requestRoutingRules() != null) { + requestRoutingRules().forEach(e -> e.validate()); + } + if (rewriteRuleSets() != null) { + rewriteRuleSets().forEach(e -> e.validate()); + } + if (redirectConfigurations() != null) { + redirectConfigurations().forEach(e -> e.validate()); + } + if (webApplicationFirewallConfiguration() != null) { + webApplicationFirewallConfiguration().validate(); + } + if (autoscaleConfiguration() != null) { + autoscaleConfiguration().validate(); + } + if (privateLinkConfigurations() != null) { + privateLinkConfigurations().forEach(e -> e.validate()); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (customErrorConfigurations() != null) { + customErrorConfigurations().forEach(e -> e.validate()); + } + 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..cde441575f63f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRedirectType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of redirect configuration of the application gateway. */ +@Fluent +public final class ApplicationGatewayRedirectConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayRedirectConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..1340f3a56176b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of request routing rule of the application gateway. */ +@Fluent +public final class ApplicationGatewayRequestRoutingRulePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayRequestRoutingRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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..f311617e000ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of rewrite rule set of the application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleSetPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleSetPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..833ad95a7c2a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.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.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of SSL certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslCertificatePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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..30c247e7cc971 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An Ssl predefined policy. */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPredefinedPolicyInner.class); + + /* + * Name of the Ssl predefined policy. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties of the application gateway SSL predefined policy. + */ + @JsonProperty(value = "properties") + private ApplicationGatewaySslPredefinedPolicyPropertiesFormat innerProperties; + + /** + * 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..852dac79f405d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ApplicationGatewaySslPredefinedPolicy. */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPredefinedPolicyPropertiesFormat.class); + + /* + * 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; + + /** + * 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..db9830be525bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.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.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of SSL profile of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslProfilePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslProfilePropertiesFormat.class); + + /* + * 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; + + /** + * 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..9cb433fa57666 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted client certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificatePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayTrustedClientCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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..4e8426ebac431 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates properties of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificatePropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApplicationGatewayTrustedRootCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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..712f33fa4a50d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of UrlPathMap of the application gateway. */ +@Fluent +public final class ApplicationGatewayUrlPathMapPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlPathMapPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..e4319d1240590 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An application security group in a resource group. */ +@Fluent +public final class ApplicationSecurityGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupInner.class); + + /* + * 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; + + /** + * 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..63f95e8fb5fd0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application security group properties. */ +@Immutable +public final class ApplicationSecurityGroupPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupPropertiesFormat.class); + + /* + * 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; + + /** + * 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..0b96c543a610b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of ExpressRouteCircuitAuthorization. */ +@Fluent +public final class AuthorizationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..3f47bd25d1e95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information of an AutoApprovedPrivateLinkService. */ +@Fluent +public final class AutoApprovedPrivateLinkServiceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoApprovedPrivateLinkServiceInner.class); + + /* + * The id of the private link service resource. + */ + @JsonProperty(value = "privateLinkService") + private String privateLinkService; + + /** + * Get the privateLinkService property: The id of the private link service resource. + * + * @return the privateLinkService value. + */ + public String privateLinkService() { + return this.privateLinkService; + } + + /** + * Set the privateLinkService property: The id of the private link service resource. + * + * @param privateLinkService the privateLinkService value to set. + * @return the AutoApprovedPrivateLinkServiceInner object itself. + */ + public AutoApprovedPrivateLinkServiceInner withPrivateLinkService(String privateLinkService) { + this.privateLinkService = privateLinkService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java new file mode 100644 index 0000000000000..33a8e5f3ae2e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. */ +@Fluent +public final class AvailableDelegationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationInner.class); + + /* + * The name of the AvailableDelegation resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailableDelegation resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the name property: The name of the AvailableDelegation resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the AvailableDelegation resource. + * + * @param name the name value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: A unique identifier of the AvailableDelegation resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier of the AvailableDelegation resource. + * + * @param id the id value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the serviceName property: The name of the service and resource. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service and resource. + * + * @param serviceName the serviceName value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The actions permitted to the service upon delegation. + * + * @param actions the actions value to set. + * @return the AvailableDelegationInner object itself. + */ + public AvailableDelegationInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java new file mode 100644 index 0000000000000..82e529a2cb5d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information of an AvailablePrivateEndpointType. */ +@Fluent +public final class AvailablePrivateEndpointTypeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypeInner.class); + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique identifier of the AvailablePrivateEndpoint Type resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The name of the service and resource. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * Display name of the resource. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: The name of the service and resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the service and resource. + * + * @param name the name value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @param id the id value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Resource type. + * + * @param type the type value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the resourceName property: The name of the service and resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of the service and resource. + * + * @param resourceName the resourceName value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the resource. + * + * @param displayName the displayName value to set. + * @return the AvailablePrivateEndpointTypeInner object itself. + */ + public AvailablePrivateEndpointTypeInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java new file mode 100644 index 0000000000000..7bd38c8e686fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of available countries with details. */ +@Fluent +public final class AvailableProvidersListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListInner.class); + + /* + * List of available countries. + */ + @JsonProperty(value = "countries", required = true) + private List countries; + + /** + * Get the countries property: List of available countries. + * + * @return the countries value. + */ + public List countries() { + return this.countries; + } + + /** + * Set the countries property: List of available countries. + * + * @param countries the countries value to set. + * @return the AvailableProvidersListInner object itself. + */ + public AvailableProvidersListInner withCountries(List countries) { + this.countries = countries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (countries() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property countries in model AvailableProvidersListInner")); + } else { + countries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java new file mode 100644 index 0000000000000..df22447ee1e3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The available service alias. */ +@Fluent +public final class AvailableServiceAliasInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasInner.class); + + /* + * The name of the service alias. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the service alias. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The type of the resource. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The resource name of the service alias. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /** + * Get the name property: The name of the service alias. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the service alias. + * + * @param name the name value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ID of the service alias. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the service alias. + * + * @param id the id value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the resource. + * + * @param type the type value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the resourceName property: The resource name of the service alias. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The resource name of the service alias. + * + * @param resourceName the resourceName value to set. + * @return the AvailableServiceAliasInner object itself. + */ + public AvailableServiceAliasInner withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..ae28837ef7aca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the application rule collection. */ +@Fluent +public final class AzureFirewallApplicationRuleCollectionPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleCollectionPropertiesFormat.class); + + /* + * 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; + + /** + * 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..da49c8a18ea99 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Azure Firewall FQDN Tag Resource. */ +@Fluent +public final class AzureFirewallFqdnTagInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagInner.class); + + /* + * 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; + + /** + * 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..5aa58a4419e6b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Firewall FQDN Tag Properties. */ +@Immutable +public final class AzureFirewallFqdnTagPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagPropertiesFormat.class); + + /* + * 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; + + /** + * 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..3fc5136956da6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Firewall resource. */ +@Fluent +public final class AzureFirewallInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallInner.class); + + /* + * 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; + + /** + * 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..5dfa900cb9370 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.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.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an Azure Firewall. */ +@Fluent +public final class AzureFirewallIpConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureFirewallIpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..39dc4fbdc02dc --- /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.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the NAT rule collection. */ +@Fluent +public final class AzureFirewallNatRuleCollectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRuleCollectionProperties.class); + + /* + * 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; + + /** + * 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..65682ae772f74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the network rule collection. */ +@Fluent +public final class AzureFirewallNetworkRuleCollectionPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRuleCollectionPropertiesFormat.class); + + /* + * 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; + + /** + * 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..8494f0d345037 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallPropertiesFormat.class); + + /* + * 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; + + /** + * 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..0d38d04ae2a66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure reachability report details. */ +@Fluent +public final class AzureReachabilityReportInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportInner.class); + + /* + * The aggregation level of Azure reachability report. Can be Country, + * State or City. + */ + @JsonProperty(value = "aggregationLevel", required = true) + private String aggregationLevel; + + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Azure reachability report items. + */ + @JsonProperty(value = "reachabilityReport", required = true) + private List reachabilityReport; + + /** + * Get the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @return the aggregationLevel value. + */ + public String aggregationLevel() { + return this.aggregationLevel; + } + + /** + * Set the aggregationLevel property: The aggregation level of Azure reachability report. Can be Country, State or + * City. + * + * @param aggregationLevel the aggregationLevel value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withAggregationLevel(String aggregationLevel) { + this.aggregationLevel = aggregationLevel; + return this; + } + + /** + * Get the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation property: Parameters that define a geographic location. + * + * @param providerLocation the providerLocation value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get the reachabilityReport property: List of Azure reachability report items. + * + * @return the reachabilityReport value. + */ + public List reachabilityReport() { + return this.reachabilityReport; + } + + /** + * Set the reachabilityReport property: List of Azure reachability report items. + * + * @param reachabilityReport the reachabilityReport value to set. + * @return the AzureReachabilityReportInner object itself. + */ + public AzureReachabilityReportInner withReachabilityReport(List reachabilityReport) { + this.reachabilityReport = reachabilityReport; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregationLevel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aggregationLevel in model AzureReachabilityReportInner")); + } + if (providerLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportInner")); + } else { + providerLocation().validate(); + } + if (reachabilityReport() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property reachabilityReport in model AzureReachabilityReportInner")); + } else { + reachabilityReport().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.java new file mode 100644 index 0000000000000..ae3829966b733 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Web Category Resource. */ +@Fluent +public final class AzureWebCategoryInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWebCategoryInner.class); + + /* + * 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; + + /** + * 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..1028073bcc1bc --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Web Category Properties. */ +@Immutable +public final class AzureWebCategoryPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWebCategoryPropertiesFormat.class); + + /* + * The name of the group that the category belongs to. + */ + @JsonProperty(value = "group", access = JsonProperty.Access.WRITE_ONLY) + private String group; + + /** + * 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..4c610adedcf78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.InboundNatRulePortMapping; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response for a QueryInboundNatRulePortMapping API. */ +@Fluent +public final class BackendAddressInboundNatRulePortMappingsInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(BackendAddressInboundNatRulePortMappingsInner.class); + + /* + * Collection of inbound NAT rule port mappings. + */ + @JsonProperty(value = "inboundNatRulePortMappings") + private List inboundNatRulePortMappings; + + /** + * 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..cd79704e47481 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pool of backend IP addresses. */ +@Fluent +public final class BackendAddressPoolInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAddressPoolInner.class); + + /* + * 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; + + /** + * 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(); + } + + /** + * 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..012ef796fa5de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the backend address pool. */ +@Fluent +public final class BackendAddressPoolPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAddressPoolPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tunnelInterfaces() != null) { + tunnelInterfaces().forEach(e -> e.validate()); + } + if (loadBalancerBackendAddresses() != null) { + loadBalancerBackendAddresses().forEach(e -> e.validate()); + } + if (backendIpConfigurations() != null) { + backendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java new file mode 100644 index 0000000000000..5c81812ffcb72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The session detail for a target. */ +@Immutable +public final class BastionActiveSessionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionActiveSessionInner.class); + + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * The time when the session started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private Object startTime; + + /* + * The subscription id for the target virtual machine. + */ + @JsonProperty(value = "targetSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String targetSubscriptionId; + + /* + * The type of the resource. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The host name of the target. + */ + @JsonProperty(value = "targetHostName", access = JsonProperty.Access.WRITE_ONLY) + private String targetHostname; + + /* + * The resource group of the target. + */ + @JsonProperty(value = "targetResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceGroup; + + /* + * The user name who is active on this session. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * The IP Address of the target. + */ + @JsonProperty(value = "targetIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String targetIpAddress; + + /* + * The protocol used to connect to the target. + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private BastionConnectProtocol protocol; + + /* + * The resource id of the target. + */ + @JsonProperty(value = "targetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String targetResourceId; + + /* + * Duration in mins the session has been active. + */ + @JsonProperty(value = "sessionDurationInMins", access = JsonProperty.Access.WRITE_ONLY) + private Float sessionDurationInMins; + + /** + * Get the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Get the startTime property: The time when the session started. + * + * @return the startTime value. + */ + public Object startTime() { + return this.startTime; + } + + /** + * Get the targetSubscriptionId property: The subscription id for the target virtual machine. + * + * @return the targetSubscriptionId value. + */ + public String targetSubscriptionId() { + return this.targetSubscriptionId; + } + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the targetHostname property: The host name of the target. + * + * @return the targetHostname value. + */ + public String targetHostname() { + return this.targetHostname; + } + + /** + * Get the targetResourceGroup property: The resource group of the target. + * + * @return the targetResourceGroup value. + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Get the username property: The user name who is active on this session. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the targetIpAddress property: The IP Address of the target. + * + * @return the targetIpAddress value. + */ + public String targetIpAddress() { + return this.targetIpAddress; + } + + /** + * Get the protocol property: The protocol used to connect to the target. + * + * @return the protocol value. + */ + public BastionConnectProtocol protocol() { + return this.protocol; + } + + /** + * Get the targetResourceId property: The resource id of the target. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Get the sessionDurationInMins property: Duration in mins the session has been active. + * + * @return the sessionDurationInMins value. + */ + public Float sessionDurationInMins() { + return this.sessionDurationInMins; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java new file mode 100644 index 0000000000000..324b9cad3f6e4 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Bastion Host resource. */ +@Fluent +public final class BastionHostInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostInner.class); + + /* + * 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; + + /** + * 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..7f8702a9bddd0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostIpConfigurationPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration of an Bastion Host. */ +@Fluent +public final class BastionHostIpConfigurationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostIpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..32dd06a4d2fdd --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Bastion Host. */ +@Fluent +public final class BastionHostPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostPropertiesFormat.class); + + /* + * 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; + + /** + * 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..99a62e938cda8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The session state detail for a target. */ +@Immutable +public final class BastionSessionStateInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionSessionStateInner.class); + + /* + * A unique id for the session. + */ + @JsonProperty(value = "sessionId", access = JsonProperty.Access.WRITE_ONLY) + private String sessionId; + + /* + * Used for extra information. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The state of the session. Disconnected/Failed/NotFound. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Get the message property: Used for extra information. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the state property: The state of the session. Disconnected/Failed/NotFound. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java new file mode 100644 index 0000000000000..90f6177165d0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VM; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Bastion Shareable Link. */ +@Fluent +public final class BastionShareableLinkInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkInner.class); + + /* + * Reference of the virtual machine resource. + */ + @JsonProperty(value = "vm", required = true) + private VM vm; + + /* + * The unique Bastion Shareable Link to the virtual machine. + */ + @JsonProperty(value = "bsl", access = JsonProperty.Access.WRITE_ONLY) + private String bsl; + + /* + * The time when the link was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Optional field indicating the warning or error message related to the vm + * in case of partial failure. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the vm property: Reference of the virtual machine resource. + * + * @return the vm value. + */ + public VM vm() { + return this.vm; + } + + /** + * Set the vm property: Reference of the virtual machine resource. + * + * @param vm the vm value to set. + * @return the BastionShareableLinkInner object itself. + */ + public BastionShareableLinkInner withVm(VM vm) { + this.vm = vm; + return this; + } + + /** + * Get the bsl property: The unique Bastion Shareable Link to the virtual machine. + * + * @return the bsl value. + */ + public String bsl() { + return this.bsl; + } + + /** + * Get the createdAt property: The time when the link was created. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the message property: Optional field indicating the warning or error message related to the vm in case of + * partial failure. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vm() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property vm in model BastionShareableLinkInner")); + } else { + vm().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.java new file mode 100644 index 0000000000000..d668d290fc1e6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@Fluent +public final class BgpConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpConnectionInner.class); + + /* + * 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; + + /** + * 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..e42f2736f6e04 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the bgp connection. */ +@Fluent +public final class BgpConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpConnectionProperties.class); + + /* + * 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; + + /** + * 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..71c63fe7c9fdb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list BGP peer status API service call. */ +@Fluent +public final class BgpPeerStatusListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatusListResultInner.class); + + /* + * List of BGP peers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of BGP peers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of BGP peers. + * + * @param value the value value to set. + * @return the BgpPeerStatusListResultInner object itself. + */ + public BgpPeerStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java new file mode 100644 index 0000000000000..a4a10d92d507a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service Community Properties. */ +@Fluent +public final class BgpServiceCommunityInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityInner.class); + + /* + * Properties of the BGP service community. + */ + @JsonProperty(value = "properties") + private BgpServiceCommunityPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..b03125ebd8e15 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Service Community. */ +@Fluent +public final class BgpServiceCommunityPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityPropertiesFormat.class); + + /* + * 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; + + /** + * 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..c691a90c3295b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the operation to create a connection monitor. */ +@Fluent +public class ConnectionMonitorParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorParameters.class); + + /* + * Describes the source of connection monitor. + */ + @JsonProperty(value = "source") + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + @JsonProperty(value = "destination") + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once + * created. + */ + @JsonProperty(value = "autoStart") + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + @JsonProperty(value = "monitoringIntervalInSeconds") + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + @JsonProperty(value = "testConfigurations") + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + @JsonProperty(value = "testGroups") + private List testGroups; + + /* + * List of connection monitor outputs. + */ + @JsonProperty(value = "outputs") + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + @JsonProperty(value = "notes") + private String notes; + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.source; + } + + /** + * Set the source property: Describes the source of connection monitor. + * + * @param source the source value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withSource(ConnectionMonitorSource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Describes the destination of connection monitor. + * + * @param destination the destination value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withDestination(ConnectionMonitorDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @return the autoStart value. + */ + public Boolean autoStart() { + return this.autoStart; + } + + /** + * Set the autoStart property: Determines if the connection monitor will start automatically once created. + * + * @param autoStart the autoStart value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withAutoStart(Boolean autoStart) { + this.autoStart = autoStart; + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.monitoringIntervalInSeconds; + } + + /** + * Set the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @param monitoringIntervalInSeconds the monitoringIntervalInSeconds value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + this.monitoringIntervalInSeconds = monitoringIntervalInSeconds; + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: List of connection monitor endpoints. + * + * @param endpoints the endpoints value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of connection monitor test configurations. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withTestConfigurations( + List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.testGroups; + } + + /** + * Set the testGroups property: List of connection monitor test groups. + * + * @param testGroups the testGroups value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withTestGroups(List testGroups) { + this.testGroups = testGroups; + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: List of connection monitor outputs. + * + * @param outputs the outputs value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the notes property: Optional notes to be associated with the connection monitor. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Optional notes to be associated with the connection monitor. + * + * @param notes the notes value to set. + * @return the ConnectionMonitorParameters object itself. + */ + public ConnectionMonitorParameters withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + if (testConfigurations() != null) { + testConfigurations().forEach(e -> e.validate()); + } + if (testGroups() != null) { + testGroups().forEach(e -> e.validate()); + } + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java new file mode 100644 index 0000000000000..9a06fa9337062 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection states snapshots. */ +@Fluent +public final class ConnectionMonitorQueryResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorQueryResultInner.class); + + /* + * Status of connection monitor source. + */ + @JsonProperty(value = "sourceStatus") + private ConnectionMonitorSourceStatus sourceStatus; + + /* + * Information about connection states. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the sourceStatus property: Status of connection monitor source. + * + * @return the sourceStatus value. + */ + public ConnectionMonitorSourceStatus sourceStatus() { + return this.sourceStatus; + } + + /** + * Set the sourceStatus property: Status of connection monitor source. + * + * @param sourceStatus the sourceStatus value to set. + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withSourceStatus(ConnectionMonitorSourceStatus sourceStatus) { + this.sourceStatus = sourceStatus; + return this; + } + + /** + * Get the states property: Information about connection states. + * + * @return the states value. + */ + public List states() { + return this.states; + } + + /** + * Set the states property: Information about connection states. + * + * @param states the states value to set. + * @return the ConnectionMonitorQueryResultInner object itself. + */ + public ConnectionMonitorQueryResultInner withStates(List states) { + this.states = states; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (states() != null) { + states().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java new file mode 100644 index 0000000000000..1ba94b5f76112 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Information about the connection monitor. */ +@Fluent +public final class ConnectionMonitorResultInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the connection monitor result. + */ + @JsonProperty(value = "properties") + private ConnectionMonitorResultProperties 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 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..9ba00e6cc37cc --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Describes the properties of a connection monitor. */ +@Fluent +public final class ConnectionMonitorResultProperties extends ConnectionMonitorParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorResultProperties.class); + + /* + * The provisioning state of the connection monitor. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The date and time when the connection monitor was started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The monitoring status of the connection monitor. + */ + @JsonProperty(value = "monitoringStatus", access = JsonProperty.Access.WRITE_ONLY) + private String monitoringStatus; + + /* + * Type of connection monitor. + */ + @JsonProperty(value = "connectionMonitorType", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionMonitorType connectionMonitorType; + + /** + * Get the provisioningState property: The provisioning state of the connection monitor. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startTime property: The date and time when the connection monitor was started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the monitoringStatus property: The monitoring status of the connection monitor. + * + * @return the monitoringStatus value. + */ + public String monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Get the connectionMonitorType property: Type of connection monitor. + * + * @return the connectionMonitorType value. + */ + public ConnectionMonitorType connectionMonitorType() { + return this.connectionMonitorType; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withSource(ConnectionMonitorSource source) { + super.withSource(source); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withDestination(ConnectionMonitorDestination destination) { + super.withDestination(destination); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withAutoStart(Boolean autoStart) { + super.withAutoStart(autoStart); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withMonitoringIntervalInSeconds(Integer monitoringIntervalInSeconds) { + super.withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withEndpoints(List endpoints) { + super.withEndpoints(endpoints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withTestConfigurations( + List testConfigurations) { + super.withTestConfigurations(testConfigurations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withTestGroups(List testGroups) { + super.withTestGroups(testGroups); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withOutputs(List outputs) { + super.withOutputs(outputs); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionMonitorResultProperties withNotes(String notes) { + super.withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java new file mode 100644 index 0000000000000..e4e55e39168fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network connection reset shared key. */ +@Fluent +public final class ConnectionResetSharedKeyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionResetSharedKeyInner.class); + + /* + * The virtual network connection reset shared key length, should between 1 + * and 128. + */ + @JsonProperty(value = "keyLength", required = true) + private int keyLength; + + /** + * Get the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @return the keyLength value. + */ + public int keyLength() { + return this.keyLength; + } + + /** + * Set the keyLength property: The virtual network connection reset shared key length, should between 1 and 128. + * + * @param keyLength the keyLength value to set. + * @return the ConnectionResetSharedKeyInner object itself. + */ + public ConnectionResetSharedKeyInner withKeyLength(int keyLength) { + this.keyLength = keyLength; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java new file mode 100644 index 0000000000000..a29c5289329b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GetConnectionSharedKey API service call. */ +@Fluent +public final class ConnectionSharedKeyInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionSharedKeyInner.class); + + /* + * The virtual network connection shared key value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the value property: The virtual network connection shared key value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The virtual network connection shared key value. + * + * @param value the value value to set. + * @return the ConnectionSharedKeyInner object itself. + */ + public ConnectionSharedKeyInner withValue(String value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectionSharedKeyInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ConnectionSharedKeyInner")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java new file mode 100644 index 0000000000000..50b956164b659 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information on the connectivity status. */ +@Immutable +public final class ConnectivityInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityInformationInner.class); + + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /* + * The connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionStatus connectionStatus; + + /* + * Average latency in milliseconds. + */ + @JsonProperty(value = "avgLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer avgLatencyInMs; + + /* + * Minimum latency in milliseconds. + */ + @JsonProperty(value = "minLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer minLatencyInMs; + + /* + * Maximum latency in milliseconds. + */ + @JsonProperty(value = "maxLatencyInMs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxLatencyInMs; + + /* + * Total number of probes sent. + */ + @JsonProperty(value = "probesSent", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesSent; + + /* + * Number of failed probes. + */ + @JsonProperty(value = "probesFailed", access = JsonProperty.Access.WRITE_ONLY) + private Integer probesFailed; + + /** + * Get the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + public List hops() { + return this.hops; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public ConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the avgLatencyInMs property: Average latency in milliseconds. + * + * @return the avgLatencyInMs value. + */ + public Integer avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Get the minLatencyInMs property: Minimum latency in milliseconds. + * + * @return the minLatencyInMs value. + */ + public Integer minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Get the maxLatencyInMs property: Maximum latency in milliseconds. + * + * @return the maxLatencyInMs value. + */ + public Integer maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Get the probesSent property: Total number of probes sent. + * + * @return the probesSent value. + */ + public Integer probesSent() { + return this.probesSent; + } + + /** + * Get the probesFailed property: Number of failed probes. + * + * @return the probesFailed value. + */ + public Integer probesFailed() { + return this.probesFailed; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hops() != null) { + hops().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..f2f5146c63636 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface configuration properties. */ +@Fluent +public final class ContainerNetworkInterfaceConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..c7822a29a0abd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the container network interface IP configuration. */ +@Immutable +public final class ContainerNetworkInterfaceIpConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ContainerNetworkInterfaceIpConfigurationPropertiesFormat.class); + + /* + * The provisioning state of the container network interface IP + * configuration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * 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..488260d1c3359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of container network interface. */ +@Fluent +public final class ContainerNetworkInterfacePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfacePropertiesFormat.class); + + /* + * 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; + + /** + * 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..c685ab6e2598e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Custom IP prefix resource. */ +@Fluent +public final class CustomIpPrefixInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixInner.class); + + /* + * The extended location of the custom IP prefix. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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; + + /** + * 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 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 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..944330cceda21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom IP prefix properties. */ +@Fluent +public final class CustomIpPrefixPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixPropertiesFormat.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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..75840282e14ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A DDoS custom policy in a resource group. */ +@Fluent +public final class DdosCustomPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPolicyInner.class); + + /* + * 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; + + /** + * 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(); + } + + /** + * Get the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This + * list is read-only. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddresses(); + } + + /** + * Get the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value. + */ + public List protocolCustomSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protocolCustomSettings(); + } + + /** + * Set the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @param protocolCustomSettings the protocolCustomSettings value to set. + * @return the DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withProtocolCustomSettings(List protocolCustomSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DdosCustomPolicyPropertiesFormat(); + } + this.innerProperties().withProtocolCustomSettings(protocolCustomSettings); + 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/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..9e59a685a5512 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyPropertiesFormat.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DDoS custom policy properties. */ +@Fluent +public final class DdosCustomPolicyPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPolicyPropertiesFormat.class); + + /* + * 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; + + /* + * The list of public IPs associated with the DDoS custom policy resource. + * This list is read-only. + */ + @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * The protocol-specific DDoS policy customization parameters. + */ + @JsonProperty(value = "protocolCustomSettings") + private List protocolCustomSettings; + + /** + * Get the resourceGuid property: The resource GUID property of the DDoS custom policy resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS custom policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This + * list is read-only. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value. + */ + public List protocolCustomSettings() { + return this.protocolCustomSettings; + } + + /** + * Set the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @param protocolCustomSettings the protocolCustomSettings value to set. + * @return the DdosCustomPolicyPropertiesFormat object itself. + */ + public DdosCustomPolicyPropertiesFormat withProtocolCustomSettings( + List protocolCustomSettings) { + this.protocolCustomSettings = protocolCustomSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocolCustomSettings() != null) { + protocolCustomSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java new file mode 100644 index 0000000000000..f51bf6d048d8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.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.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A DDoS protection plan in a resource group. */ +@Fluent +public final class DdosProtectionPlanInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanInner.class); + + /* + * 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; + + /** + * 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 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..b1e7ee6725bb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanPropertiesFormat.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.Immutable; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DDoS protection plan properties. */ +@Immutable +public final class DdosProtectionPlanPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanPropertiesFormat.class); + + /* + * 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 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; + + /** + * Get the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS protection plan resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan resource. + * This list is read-only. + * + * @return the virtualNetworks value. + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..3465c028c92bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the CheckDnsNameAvailability API service call. */ +@Fluent +public final class DnsNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsNameAvailabilityResultInner.class); + + /* + * Domain availability (True/False). + */ + @JsonProperty(value = "available") + private Boolean available; + + /** + * Get the available property: Domain availability (True/False). + * + * @return the available value. + */ + public Boolean available() { + return this.available; + } + + /** + * Set the available property: Domain availability (True/False). + * + * @param available the available value to set. + * @return the DnsNameAvailabilityResultInner object itself. + */ + public DnsNameAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.java new file mode 100644 index 0000000000000..e5c03b9e9b8bf --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Differentiated Services Code Point configuration for any given network interface. */ +@Fluent +public final class DscpConfigurationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationInner.class); + + /* + * 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; + + /** + * 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..a468a4960b26e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Differentiated Services Code Point configuration properties. */ +@Fluent +public final class DscpConfigurationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..53da2145c4770 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective network security groups API service call. */ +@Fluent +public final class EffectiveNetworkSecurityGroupListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupListResultInner.class); + + /* + * A list of effective network security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of effective network security groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of effective network security groups. + * + * @param value the value value to set. + * @return the EffectiveNetworkSecurityGroupListResultInner object itself. + */ + public EffectiveNetworkSecurityGroupListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java new file mode 100644 index 0000000000000..a64daabff7fe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list effective route API service call. */ +@Fluent +public final class EffectiveRouteListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRouteListResultInner.class); + + /* + * A list of effective routes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of effective routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of effective routes. + * + * @param value the value value to set. + * @return the EffectiveRouteListResultInner object itself. + */ + public EffectiveRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java new file mode 100644 index 0000000000000..0d7cefe3807ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Endpoint service. */ +@Fluent +public final class EndpointServiceResultInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServiceResultInner.class); + + /* + * Name of the endpoint service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Type of the endpoint service. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the name property: Name of the endpoint service. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Type of the endpoint service. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public EndpointServiceResultInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.java new file mode 100644 index 0000000000000..226ac749660b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authorization in an ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitAuthorizationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationInner.class); + + /* + * 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; + + /** + * 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..08a10815d9876 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@Fluent +public final class ExpressRouteCircuitConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionInner.class); + + /* + * 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; + + /** + * 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..858ee404d6bfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the express route circuit connection. */ +@Fluent +public final class ExpressRouteCircuitConnectionPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionPropertiesFormat.class); + + /* + * 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; + + /** + * 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..60cdc91753849 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.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.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitInner.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..7f0ff3bfcf85e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Peering in an ExpressRouteCircuit resource. */ +@Fluent +public final class ExpressRouteCircuitPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringInner.class); + + /* + * 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; + + /** + * 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..9f9698041b725 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the express route circuit peering. */ +@Fluent +public final class ExpressRouteCircuitPeeringPropertiesFormatInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..edc281e574f01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..0fe8b429db7b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains stats associated with the peering. */ +@Fluent +public final class ExpressRouteCircuitStatsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitStatsInner.class); + + /* + * The Primary BytesIn of the peering. + */ + @JsonProperty(value = "primarybytesIn") + private Long primarybytesIn; + + /* + * The primary BytesOut of the peering. + */ + @JsonProperty(value = "primarybytesOut") + private Long primarybytesOut; + + /* + * The secondary BytesIn of the peering. + */ + @JsonProperty(value = "secondarybytesIn") + private Long secondarybytesIn; + + /* + * The secondary BytesOut of the peering. + */ + @JsonProperty(value = "secondarybytesOut") + private Long secondarybytesOut; + + /** + * Get the primarybytesIn property: The Primary BytesIn of the peering. + * + * @return the primarybytesIn value. + */ + public Long primarybytesIn() { + return this.primarybytesIn; + } + + /** + * Set the primarybytesIn property: The Primary BytesIn of the peering. + * + * @param primarybytesIn the primarybytesIn value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesIn(Long primarybytesIn) { + this.primarybytesIn = primarybytesIn; + return this; + } + + /** + * Get the primarybytesOut property: The primary BytesOut of the peering. + * + * @return the primarybytesOut value. + */ + public Long primarybytesOut() { + return this.primarybytesOut; + } + + /** + * Set the primarybytesOut property: The primary BytesOut of the peering. + * + * @param primarybytesOut the primarybytesOut value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withPrimarybytesOut(Long primarybytesOut) { + this.primarybytesOut = primarybytesOut; + return this; + } + + /** + * Get the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @return the secondarybytesIn value. + */ + public Long secondarybytesIn() { + return this.secondarybytesIn; + } + + /** + * Set the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @param secondarybytesIn the secondarybytesIn value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesIn(Long secondarybytesIn) { + this.secondarybytesIn = secondarybytesIn; + return this; + } + + /** + * Get the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @return the secondarybytesOut value. + */ + public Long secondarybytesOut() { + return this.secondarybytesOut; + } + + /** + * Set the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @param secondarybytesOut the secondarybytesOut value to set. + * @return the ExpressRouteCircuitStatsInner object itself. + */ + public ExpressRouteCircuitStatsInner withSecondarybytesOut(Long secondarybytesOut) { + this.secondarybytesOut = secondarybytesOut; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java new file mode 100644 index 0000000000000..56e2ba66559f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListArpTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsArpTableListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsArpTableListResultInner.class); + + /* + * A list of the ARP tables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of the ARP tables. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the ARP tables. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsArpTableListResultInner object itself. + */ + public ExpressRouteCircuitsArpTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java new file mode 100644 index 0000000000000..cc92c14c9bd2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableListResultInner.class); + + /* + * The list of routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsRoutesTableListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java new file mode 100644 index 0000000000000..7f0b261189d3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Circuits API. */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableSummaryListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsRoutesTableSummaryListResultInner.class); + + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of the routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java new file mode 100644 index 0000000000000..6d2cb22f609bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteConnection resource. */ +@Fluent +public final class ExpressRouteConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionInner.class); + + /* + * 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; + + /** + * 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 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")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java new file mode 100644 index 0000000000000..d837c40f27f3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRouteConnection list. */ +@Fluent +public final class ExpressRouteConnectionListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionListInner.class); + + /* + * The list of ExpressRoute connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of ExpressRoute connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of ExpressRoute connections. + * + * @param value the value value to set. + * @return the ExpressRouteConnectionListInner object itself. + */ + public ExpressRouteConnectionListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..9536d621f50d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionProperties.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the ExpressRouteConnection subresource. */ +@Fluent +public final class ExpressRouteConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionProperties.class); + + /* + * 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; + + /* + * The Routing Configuration indicating the associated and propagated route + * tables on this connection. + */ + @JsonProperty(value = "routingConfiguration") + private RoutingConfiguration routingConfiguration; + + /** + * 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 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(); + } + } +} 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..e89247cf119dd --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRouteCrossConnection resource. */ +@Fluent +public final class ExpressRouteCrossConnectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionInner.class); + + /* + * 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; + + /** + * 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..c8130da787b6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringInner.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.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.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peering in an ExpressRoute Cross Connection resource. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringInner.class); + + /* + * 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; + + /** + * 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..2383251174e22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringProperties.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of express route cross connection peering. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringProperties.class); + + /* + * 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; + + /** + * 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..fb31b7422fba6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteCrossConnection. */ +@Fluent +public final class ExpressRouteCrossConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionProperties.class); + + /* + * 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; + + /** + * 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..14338e4c9fa85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListRoutesTable associated with the Express Route Cross Connections. */ +@Fluent +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class); + + /* + * A list of the routes table. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of the routes table. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of the routes table. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner object itself. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java new file mode 100644 index 0000000000000..ba5f226f039ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoute gateway resource. */ +@Fluent +public final class ExpressRouteGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayInner.class); + + /* + * 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; + + /** + * 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(); + } + + /** + * 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; + } + + /** + * 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..386c1bc94e7aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of ExpressRoute gateways. */ +@Fluent +public final class ExpressRouteGatewayListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayListInner.class); + + /* + * List of ExpressRoute gateways. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of ExpressRoute gateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of ExpressRoute gateways. + * + * @param value the value value to set. + * @return the ExpressRouteGatewayListInner object itself. + */ + public ExpressRouteGatewayListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..84d9978ec8ab7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoute gateway resource properties. */ +@Fluent +public final class ExpressRouteGatewayProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayProperties.class); + + /* + * Configuration for auto scaling. + */ + @JsonProperty(value = "autoScaleConfiguration") + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /* + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + @JsonProperty(value = "expressRouteConnections", access = JsonProperty.Access.WRITE_ONLY) + 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; + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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(); + } + } +} 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..1930f5583747f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteLink ExpressRouteLink child resource definition. */ +@Fluent +public final class ExpressRouteLinkInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkInner.class); + + /* + * 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; + + /** + * 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 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..992b78a210d38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkPropertiesFormat.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRouteLink Resource Properties Properties specific to ExpressRouteLink resources. */ +@Fluent +public final class ExpressRouteLinkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkPropertiesFormat.class); + + /* + * 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; + + /* + * 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; + + /** + * Get the routerName property: Name of Azure router associated with physical port. + * + * @return the routerName value. + */ + public String routerName() { + return this.routerName; + } + + /** + * Get the interfaceName property: Name of Azure router interface. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get the patchPanelId property: Mapping between physical port to patch panel port. + * + * @return the patchPanelId value. + */ + public String patchPanelId() { + return this.patchPanelId; + } + + /** + * Get the rackId property: Mapping of physical patch panel to rack. + * + * @return the rackId value. + */ + public String rackId() { + return this.rackId; + } + + /** + * Get the connectorType property: Physical fiber port type. + * + * @return the connectorType value. + */ + public ExpressRouteLinkConnectorType connectorType() { + return this.connectorType; + } + + /** + * Get the adminState property: Administrative state of the physical port. + * + * @return the adminState value. + */ + public ExpressRouteLinkAdminState adminState() { + return this.adminState; + } + + /** + * Set the adminState property: Administrative state of the physical port. + * + * @param adminState the adminState value to set. + * @return the 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..772b80ea8a4a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.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.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.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoute Port Authorization ExpressRoutePort Authorization resource definition. */ +@Fluent +public final class ExpressRoutePortAuthorizationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortAuthorizationInner.class); + + /* + * 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; + + /** + * 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 circuit property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuit value. + */ + public SubResource circuit() { + return this.innerProperties() == null ? null : this.innerProperties().circuit(); + } + + /** + * 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..3255d08ec5347 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoute Port Authorization Properties Properties of ExpressRoutePort Authorization. */ +@Immutable +public final class ExpressRoutePortAuthorizationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRoutePortAuthorizationPropertiesFormat.class); + + /* + * 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 = "circuit", access = JsonProperty.Access.WRITE_ONLY) + private SubResource circuit; + + /* + * The provisioning state of the authorization resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * 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 circuit property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuit value. + */ + public SubResource circuit() { + return this.circuit; + } + + /** + * 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..a8dded0383afe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoute Port ExpressRoutePort resource definition. */ +@Fluent +public final class ExpressRoutePortInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortInner.class); + + /* + * 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; + + /** + * 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(); + } + + /** + * 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..734bd0c130456 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortPropertiesFormat.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoutePort Properties Properties specific to ExpressRoutePort resources. */ +@Fluent +public final class ExpressRoutePortPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..6799ed5bdca73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.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.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ExpressRoutePorts Peering Location Definition of the ExpressRoutePorts peering location resource. */ +@Fluent +public final class ExpressRoutePortsLocationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationInner.class); + + /* + * ExpressRoutePorts Location Properties ExpressRoutePort peering location + * properties. + */ + @JsonProperty(value = "properties") + private ExpressRoutePortsLocationPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..2c535d3e4bf4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoutePorts Location Properties Properties specific to ExpressRoutePorts peering location resources. */ +@Fluent +public final class ExpressRoutePortsLocationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..1cdb45fae9822 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A ExpressRouteResourceProvider object. */ +@Fluent +public final class ExpressRouteServiceProviderInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderInner.class); + + /* + * Properties of the express route service provider. + */ + @JsonProperty(value = "properties") + private ExpressRouteServiceProviderPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..7d57591e5d02c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ExpressRouteServiceProvider. */ +@Fluent +public final class ExpressRouteServiceProviderPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderPropertiesFormat.class); + + /* + * 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; + + /** + * 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..987e807953b14 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxySettings; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** FirewallPolicy Resource. */ +@Fluent +public final class FirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyInner.class); + + /* + * 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; + + /** + * 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 explicitProxySettings property: Explicit Proxy Settings definition. + * + * @return the explicitProxySettings value. + */ + public ExplicitProxySettings explicitProxySettings() { + return this.innerProperties() == null ? null : this.innerProperties().explicitProxySettings(); + } + + /** + * Set the explicitProxySettings property: Explicit Proxy Settings definition. + * + * @param explicitProxySettings the explicitProxySettings value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withExplicitProxySettings(ExplicitProxySettings explicitProxySettings) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withExplicitProxySettings(explicitProxySettings); + 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..3b291ceae95d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyPropertiesFormat.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxySettings; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Firewall Policy definition. */ +@Fluent +public final class FirewallPolicyPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyPropertiesFormat.class); + + /* + * 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 = "explicitProxySettings") + private ExplicitProxySettings explicitProxySettings; + + /* + * 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; + + /** + * 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 explicitProxySettings property: Explicit Proxy Settings definition. + * + * @return the explicitProxySettings value. + */ + public ExplicitProxySettings explicitProxySettings() { + return this.explicitProxySettings; + } + + /** + * Set the explicitProxySettings property: Explicit Proxy Settings definition. + * + * @param explicitProxySettings the explicitProxySettings value to set. + * @return the FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withExplicitProxySettings(ExplicitProxySettings explicitProxySettings) { + this.explicitProxySettings = explicitProxySettings; + 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 (explicitProxySettings() != null) { + explicitProxySettings().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..438bf3cf63a76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rule Collection Group resource. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupInner.class); + + /* + * 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; + + /** + * 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..7b5ce2c5380f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupProperties.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the rule collection group. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupProperties.class); + + /* + * 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; + + /** + * 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..e469266543f58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information on the configuration of flow log and traffic analytics (optional) . */ +@Fluent +public final class FlowLogInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogInformationInner.class); + + /* + * The ID of the resource to configure for flow log and traffic analytics + * (optional) . + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * 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; + + /** + * 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(); + } + } +} 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..be66e171ff091 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A flow log resource. */ +@Fluent +public final class FlowLogInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogInner.class); + + /* + * 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; + + /** + * 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..fe898e99e4c14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogProperties.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of flow log. */ +@Fluent +public final class FlowLogProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogProperties.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..3f254a8fa02c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of flow log. */ +@Fluent +public final class FlowLogPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogPropertiesFormat.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..daf140d803419 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.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.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.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Frontend IP address of the load balancer. */ +@Fluent +public final class FrontendIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FrontendIpConfigurationInner.class); + + /* + * 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; + + /** + * 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..560d12178f96e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of Frontend IP Configuration of the load balancer. */ +@Fluent +public final class FrontendIpConfigurationPropertiesFormatInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FrontendIpConfigurationPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..f835029558555 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway routes. */ +@Fluent +public final class GatewayRouteListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteListResultInner.class); + + /* + * List of gateway routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of gateway routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of gateway routes. + * + * @param value the value value to set. + * @return the GatewayRouteListResultInner object itself. + */ + public GatewayRouteListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java new file mode 100644 index 0000000000000..8adad211a9a00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for GenerateExpressRoutePortsLOA API service call. */ +@Fluent +public final class GenerateExpressRoutePortsLoaResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateExpressRoutePortsLoaResultInner.class); + + /* + * The content as a base64 encoded string. + */ + @JsonProperty(value = "encodedContent") + private String encodedContent; + + /** + * Get the encodedContent property: The content as a base64 encoded string. + * + * @return the encodedContent value. + */ + public String encodedContent() { + return this.encodedContent; + } + + /** + * Set the encodedContent property: The content as a base64 encoded string. + * + * @param encodedContent the encodedContent value to set. + * @return the GenerateExpressRoutePortsLoaResultInner object itself. + */ + public GenerateExpressRoutePortsLoaResultInner withEncodedContent(String encodedContent) { + this.encodedContent = encodedContent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..8ac1aae3fa98f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hop link properties. */ +@Immutable +public final class HopLinkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HopLinkProperties.class); + + /* + * 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; + + /** + * 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..8b596ceba62a9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpConfigurations. */ +@Fluent +public final class HubIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubIpConfigurationInner.class); + + /* + * 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; + + /** + * 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..641e4e1f74892 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration. */ +@Fluent +public final class HubIpConfigurationPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubIpConfigurationPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..d67773e07eade --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable resource in a virtual hub. */ +@Fluent +public final class HubRouteTableInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRouteTableInner.class); + + /* + * 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; + + /** + * 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..f31c215eeea3c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for RouteTable. */ +@Fluent +public final class HubRouteTableProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRouteTableProperties.class); + + /* + * 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; + + /** + * 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..f7f95dd987276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HubVirtualNetworkConnection Resource. */ +@Fluent +public final class HubVirtualNetworkConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionInner.class); + + /* + * 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; + + /** + * 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..145faeb370ee9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionProperties.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for HubVirtualNetworkConnection. */ +@Fluent +public final class HubVirtualNetworkConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionProperties.class); + + /* + * 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; + + /** + * 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..ab2cae264bfc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Inbound NAT pool. */ +@Fluent +public final class InboundNatPoolPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatPoolPropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..a4604e07d5193 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT rule of the load balancer. */ +@Fluent +public final class InboundNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleInner.class); + + /* + * 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; + + /** + * 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..2356b8e2cfb7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRulePropertiesFormatInner.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the inbound NAT rule. */ +@Fluent +public final class InboundNatRulePropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRulePropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..db700997b104f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NVA Inbound Security Rule resource. */ +@Fluent +public final class InboundSecurityRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRuleInner.class); + + /* + * 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; + + /** + * 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..894820f5f86db --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Inbound Security Rules resource. */ +@Fluent +public final class InboundSecurityRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRuleProperties.class); + + /* + * 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; + + /** + * 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..766b422ad4dd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for CheckIPAddressAvailability API service call. */ +@Fluent +public final class IpAddressAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddressAvailabilityResultInner.class); + + /* + * Private IP address availability. + */ + @JsonProperty(value = "available") + private Boolean available; + + /* + * Contains other available private IP addresses if the asked for address + * is taken. + */ + @JsonProperty(value = "availableIPAddresses") + private List availableIpAddresses; + + /* + * Private IP address platform reserved. + */ + @JsonProperty(value = "isPlatformReserved") + private Boolean isPlatformReserved; + + /** + * Get the available property: Private IP address availability. + * + * @return the available value. + */ + public Boolean available() { + return this.available; + } + + /** + * Set the available property: Private IP address availability. + * + * @param available the available value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @return the availableIpAddresses value. + */ + public List availableIpAddresses() { + return this.availableIpAddresses; + } + + /** + * Set the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @param availableIpAddresses the availableIpAddresses value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withAvailableIpAddresses(List availableIpAddresses) { + this.availableIpAddresses = availableIpAddresses; + return this; + } + + /** + * Get the isPlatformReserved property: Private IP address platform reserved. + * + * @return the isPlatformReserved value. + */ + public Boolean isPlatformReserved() { + return this.isPlatformReserved; + } + + /** + * Set the isPlatformReserved property: Private IP address platform reserved. + * + * @param isPlatformReserved the isPlatformReserved value to set. + * @return the IpAddressAvailabilityResultInner object itself. + */ + public IpAddressAvailabilityResultInner withIsPlatformReserved(Boolean isPlatformReserved) { + this.isPlatformReserved = isPlatformReserved; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java new file mode 100644 index 0000000000000..f1b9f6d51e726 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** IpAllocation resource. */ +@Fluent +public final class IpAllocationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationInner.class); + + /* + * 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; + + /** + * 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..32ac027ea6cb1 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties of the IpAllocation. */ +@Fluent +public final class IpAllocationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..b8fba8fb0eb13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration. */ +@Fluent +public final class IpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationInner.class); + + /* + * 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; + + /** + * 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..78515ec72650a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration profile child resource. */ +@Fluent +public final class IpConfigurationProfileInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationProfileInner.class); + + /* + * 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; + + /** + * 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..e67d5a8a56865 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfilePropertiesFormatInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration profile properties. */ +@Fluent +public final class IpConfigurationProfilePropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationProfilePropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..5dda87ea0e80a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of IP configuration. */ +@Fluent +public final class IpConfigurationPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..cf650c157b382 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The IpGroups resource information. */ +@Fluent +public final class IpGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupInner.class); + + /* + * 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; + + /** + * 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..4b6263780571b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupPropertiesFormat.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The IpGroups property information. */ +@Fluent +public final class IpGroupPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupPropertiesFormat.class); + + /* + * 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; + + /** + * 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/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..1b51dec46b44e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NatRulePortMapping; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer backend addresses. */ +@Fluent +public final class LoadBalancerBackendAddressPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..4e44198951afb --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** LoadBalancer resource. */ +@Fluent +public final class LoadBalancerInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The load balancer SKU. + */ + @JsonProperty(value = "sku") + private LoadBalancerSku sku; + + /* + * 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; + + /** + * 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..a37c84a80ec9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerPropertiesFormat.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer. */ +@Fluent +public final class LoadBalancerPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerPropertiesFormat.class); + + /* + * 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; + + /** + * 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..680bc7c759e84 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of VIP swap request's frontend IP configuration object. */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfigurationProperties { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.class); + + /* + * A reference to public IP address resource. + */ + @JsonProperty(value = "publicIPAddress") + private SubResource publicIpAddress; + + /** + * 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..896c564a8aa4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRuleInner.class); + + /* + * 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; + + /** + * 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..9a26d44f16b2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRulePropertiesFormat.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the load balancer. */ +@Fluent +public final class LoadBalancingRulePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..333a490a45a7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A common class for general resource information. */ +@Fluent +public final class LocalNetworkGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayInner.class); + + /* + * 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; + + /** + * 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(); + } + } +} 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..814fa147f7b2b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** LocalNetworkGateway properties. */ +@Fluent +public final class LocalNetworkGatewayPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayPropertiesFormat.class); + + /* + * 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; + + /** + * 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..804ff2eaadbe6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Nat Gateway resource. */ +@Fluent +public final class NatGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewayInner.class); + + /* + * 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; + + /** + * 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..46b0bdcc2f5c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Nat Gateway properties. */ +@Fluent +public final class NatGatewayPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewayPropertiesFormat.class); + + /* + * 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; + + /** + * 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..93ca7fbb26691 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Results of network configuration diagnostic on the target resource. */ +@Immutable +public final class NetworkConfigurationDiagnosticResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResponseInner.class); + + /* + * List of network configuration diagnostic results. + */ + @JsonProperty(value = "results", access = JsonProperty.Access.WRITE_ONLY) + private List results; + + /** + * Get the results property: List of network configuration diagnostic results. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (results() != null) { + results().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java new file mode 100644 index 0000000000000..0645bdb20ec34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A network interface in a resource group. */ +@Fluent +public final class NetworkInterfaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceInner.class); + + /* + * The extended location of the network interface. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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; + + /** + * 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 accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); + } + + /** + * Set the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.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; + } + + /** + * 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..d9b8fad42ecab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** IPConfiguration in a network interface. */ +@Fluent +public final class NetworkInterfaceIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationInner.class); + + /* + * 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; + + /** + * 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..39a92fba9d94b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of IP configuration. */ +@Fluent +public final class NetworkInterfaceIpConfigurationPropertiesFormatInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..2e73ffb33b7fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.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.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkInterface properties. */ +@Fluent +public final class NetworkInterfacePropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfacePropertiesFormatInner.class); + + /* + * 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 accelerated networking enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * 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; + + /** + * 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 accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: If the network interface is accelerated networking enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the 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; + } + + /** + * 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..07e70b220cb5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tap configuration in a Network Interface. */ +@Fluent +public final class NetworkInterfaceTapConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationInner.class); + + /* + * 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; + + /** + * 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..04c734792a9ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Virtual Network Tap configuration. */ +@Fluent +public final class NetworkInterfaceTapConfigurationPropertiesFormatInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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/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..5488f2a638d51 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Network profile resource. */ +@Fluent +public final class NetworkProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileInner.class); + + /* + * 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; + + /** + * 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..2d75b39dcb21c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network profile properties. */ +@Fluent +public final class NetworkProfilePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfilePropertiesFormat.class); + + /* + * 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; + + /** + * 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..b7dbceeb625f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.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.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkSecurityGroup resource. */ +@Fluent +public final class NetworkSecurityGroupInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupInner.class); + + /* + * 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; + + /** + * 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 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..8cbb739048ffe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupPropertiesFormat.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Security Group resource. */ +@Fluent +public final class NetworkSecurityGroupPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupPropertiesFormat.class); + + /* + * 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; + + /** + * 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..d3072f0f13d69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** NetworkVirtualAppliance Resource. */ +@Fluent +public final class NetworkVirtualApplianceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceInner.class); + + /* + * 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; + + /** + * 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. + * + * @return the virtualApplianceAsn value. + */ + public Long virtualApplianceAsn() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceAsn(); + } + + /** + * Set the virtualApplianceAsn property: VirtualAppliance ASN. + * + * @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(); + } + + /** + * 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..90b0d5b3cb60e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.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.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.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Virtual Appliance definition. */ +@Fluent +public final class NetworkVirtualAppliancePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualAppliancePropertiesFormat.class); + + /* + * 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. + */ + @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; + + /** + * 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. + * + * @return the virtualApplianceAsn value. + */ + public Long virtualApplianceAsn() { + return this.virtualApplianceAsn; + } + + /** + * Set the virtualApplianceAsn property: VirtualAppliance ASN. + * + * @param virtualApplianceAsn the virtualApplianceAsn value to set. + * @return the 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; + } + + /** + * 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()); + } + } +} 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..e6a2722857499 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.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.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Available NetworkVirtualApplianceSkus Definition of the NetworkVirtualApplianceSkus resource. */ +@Fluent +public final class NetworkVirtualApplianceSkuInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuInner.class); + + /* + * 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; + + /** + * 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..3f5a9f3330462 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Virtual Appliance Sku Properties Properties specific to NetworkVirtualApplianceSkus. */ +@Fluent +public final class NetworkVirtualApplianceSkuPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuPropertiesFormat.class); + + /* + * 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; + + /** + * 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..6328d9db3d8a8 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network watcher in a resource group. */ +@Fluent +public final class NetworkWatcherInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the network watcher. + */ + @JsonProperty(value = "properties") + private NetworkWatcherPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the 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..38b3d04897348 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network watcher properties. */ +@Immutable +public final class NetworkWatcherPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherPropertiesFormat.class); + + /* + * The provisioning state of the network watcher resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * 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..9f088c9d358a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.NextHopType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information about next hop from the specified VM. */ +@Fluent +public final class NextHopResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopResultInner.class); + + /* + * Next hop type. + */ + @JsonProperty(value = "nextHopType") + private NextHopType nextHopType; + + /* + * Next hop IP Address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /* + * The resource identifier for the route table associated with the route + * being returned. If the route being returned does not correspond to any + * user created routes then this field will be the string 'System Route'. + */ + @JsonProperty(value = "routeTableId") + private String routeTableId; + + /** + * Get the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + public NextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: Next hop type. + * + * @param nextHopType the nextHopType value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopType(NextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHopIpAddress property: Next hop IP Address. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: Next hop IP Address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @return the routeTableId value. + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @param routeTableId the routeTableId value to set. + * @return the NextHopResultInner object itself. + */ + public NextHopResultInner withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..98f6be62df0a9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network REST API operation definition. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation properties format. + */ + @JsonProperty(value = "properties") + private OperationPropertiesFormat innerProperties; + + /** + * 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..103d2e3de4190 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of operation properties format. */ +@Fluent +public final class OperationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationPropertiesFormat.class); + + /* + * Specification of the service. + */ + @JsonProperty(value = "serviceSpecification") + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * 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..58fbee794674c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Outbound rule of the load balancer. */ +@Fluent +public final class OutboundRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundRuleInner.class); + + /* + * 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; + + /** + * 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..4579cd0f011a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRulePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Outbound rule of the load balancer. */ +@Fluent +public final class OutboundRulePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..041a50005e4a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for P2SConnectionConfiguration. */ +@Fluent +public final class P2SConnectionConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SConnectionConfigurationProperties.class); + + /* + * 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; + + /* + * The provisioning state of the P2SConnectionConfiguration resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * 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 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java new file mode 100644 index 0000000000000..d2adeedab8a75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** P2S Vpn connection detailed health written to sas url. */ +@Fluent +public final class P2SVpnConnectionHealthInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionHealthInner.class); + + /* + * Returned sas url of the blob to which the p2s vpn connection detailed + * health will be written. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: Returned sas url of the blob to which the p2s vpn connection detailed health will be + * written. + * + * @param sasUrl the sasUrl value to set. + * @return the P2SVpnConnectionHealthInner object itself. + */ + public P2SVpnConnectionHealthInner withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.java new file mode 100644 index 0000000000000..941b0df5a7e10 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** P2SVpnGateway Resource. */ +@Fluent +public final class P2SVpnGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayInner.class); + + /* + * 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; + + /** + * 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..e8cd3ecb35d25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayProperties.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.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for P2SVpnGateway. */ +@Fluent +public final class P2SVpnGatewayProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewayProperties.class); + + /* + * 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; + + /** + * 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..f3d59972555ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the create packet capture operation. */ +@Fluent +public class PacketCaptureParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureParameters.class); + + /* + * The ID of the targeted resource, only VM is currently supported. + */ + @JsonProperty(value = "target", required = true) + private String target; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + @JsonProperty(value = "bytesToCapturePerPacket") + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + @JsonProperty(value = "totalBytesPerSession") + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + @JsonProperty(value = "timeLimitInSeconds") + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + @JsonProperty(value = "storageLocation", required = true) + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + @JsonProperty(value = "filters") + private List filters; + + /** + * Get the target property: The ID of the targeted resource, only VM is currently supported. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The ID of the targeted resource, only VM is currently supported. + * + * @param target the target value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @return the bytesToCapturePerPacket value. + */ + public Long bytesToCapturePerPacket() { + return this.bytesToCapturePerPacket; + } + + /** + * Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated. + * + * @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + this.bytesToCapturePerPacket = bytesToCapturePerPacket; + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.totalBytesPerSession; + } + + /** + * Set the totalBytesPerSession property: Maximum size of the capture output. + * + * @param totalBytesPerSession the totalBytesPerSession value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTotalBytesPerSession(Long totalBytesPerSession) { + this.totalBytesPerSession = totalBytesPerSession; + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.timeLimitInSeconds; + } + + /** + * Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @param timeLimitInSeconds the timeLimitInSeconds value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTimeLimitInSeconds(Integer timeLimitInSeconds) { + this.timeLimitInSeconds = timeLimitInSeconds; + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.storageLocation; + } + + /** + * Set the storageLocation property: The storage location for a packet capture session. + * + * @param storageLocation the storageLocation value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withStorageLocation(PacketCaptureStorageLocation storageLocation) { + this.storageLocation = storageLocation; + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of packet capture filters. + * + * @param filters the filters value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model PacketCaptureParameters")); + } + if (storageLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageLocation in model PacketCaptureParameters")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java new file mode 100644 index 0000000000000..60cfbfaa4ff05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Status of packet capture session. */ +@Fluent +public final class PacketCaptureQueryStatusResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureQueryStatusResultInner.class); + + /* + * The name of the packet capture resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the packet capture resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The start time of the packet capture session. + */ + @JsonProperty(value = "captureStartTime") + private OffsetDateTime captureStartTime; + + /* + * The status of the packet capture session. + */ + @JsonProperty(value = "packetCaptureStatus") + private PcStatus packetCaptureStatus; + + /* + * The reason the current packet capture session was stopped. + */ + @JsonProperty(value = "stopReason") + private String stopReason; + + /* + * List of errors of packet capture session. + */ + @JsonProperty(value = "packetCaptureError") + private List packetCaptureError; + + /** + * Get the name property: The name of the packet capture resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the packet capture resource. + * + * @param name the name value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: The ID of the packet capture resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the packet capture resource. + * + * @param id the id value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the captureStartTime property: The start time of the packet capture session. + * + * @return the captureStartTime value. + */ + public OffsetDateTime captureStartTime() { + return this.captureStartTime; + } + + /** + * Set the captureStartTime property: The start time of the packet capture session. + * + * @param captureStartTime the captureStartTime value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withCaptureStartTime(OffsetDateTime captureStartTime) { + this.captureStartTime = captureStartTime; + return this; + } + + /** + * Get the packetCaptureStatus property: The status of the packet capture session. + * + * @return the packetCaptureStatus value. + */ + public PcStatus packetCaptureStatus() { + return this.packetCaptureStatus; + } + + /** + * Set the packetCaptureStatus property: The status of the packet capture session. + * + * @param packetCaptureStatus the packetCaptureStatus value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureStatus(PcStatus packetCaptureStatus) { + this.packetCaptureStatus = packetCaptureStatus; + return this; + } + + /** + * Get the stopReason property: The reason the current packet capture session was stopped. + * + * @return the stopReason value. + */ + public String stopReason() { + return this.stopReason; + } + + /** + * Set the stopReason property: The reason the current packet capture session was stopped. + * + * @param stopReason the stopReason value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withStopReason(String stopReason) { + this.stopReason = stopReason; + return this; + } + + /** + * Get the packetCaptureError property: List of errors of packet capture session. + * + * @return the packetCaptureError value. + */ + public List packetCaptureError() { + return this.packetCaptureError; + } + + /** + * Set the packetCaptureError property: List of errors of packet capture session. + * + * @param packetCaptureError the packetCaptureError value to set. + * @return the PacketCaptureQueryStatusResultInner object itself. + */ + public PacketCaptureQueryStatusResultInner withPacketCaptureError(List packetCaptureError) { + this.packetCaptureError = packetCaptureError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java new file mode 100644 index 0000000000000..41e62f5a8191d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about packet capture session. */ +@Fluent +public final class PacketCaptureResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultInner.class); + + /* + * Name of the packet capture session. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * ID of the packet capture operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the packet capture result. + */ + @JsonProperty(value = "properties") + private PacketCaptureResultProperties innerProperties; + + /** + * 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 VM is 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 VM is 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 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..93b03c4b14ce4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultProperties.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a packet capture session. */ +@Fluent +public final class PacketCaptureResultProperties extends PacketCaptureParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureResultProperties.class); + + /* + * The provisioning state of the packet capture session. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTarget(String target) { + super.withTarget(target); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withBytesToCapturePerPacket(Long bytesToCapturePerPacket) { + super.withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTotalBytesPerSession(Long totalBytesPerSession) { + super.withTotalBytesPerSession(totalBytesPerSession); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withTimeLimitInSeconds(Integer timeLimitInSeconds) { + super.withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withStorageLocation(PacketCaptureStorageLocation storageLocation) { + super.withStorageLocation(storageLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public PacketCaptureResultProperties withFilters(List filters) { + super.withFilters(filters); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/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..01c78bcbe75bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. */ +@Fluent +public final class PeerExpressRouteCircuitConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionInner.class); + + /* + * 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; + + /** + * 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..019b7aad89d03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionPropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the peer express route circuit connection. */ +@Fluent +public final class PeerExpressRouteCircuitConnectionPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionPropertiesFormat.class); + + /* + * 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; + + /** + * 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..b747686dac72c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerRouteListInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual router peer routes. */ +@Fluent +public final class PeerRouteListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerRouteListInner.class); + + /* + * List of peer routes. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of peer routes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of peer routes. + * + * @param value the value value to set. + * @return the PeerRouteListInner object itself. + */ + public PeerRouteListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.java new file mode 100644 index 0000000000000..bc0a8d3c97f83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private dns zone group resource. */ +@Fluent +public final class PrivateDnsZoneGroupInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupInner.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Properties of the private dns zone group. + */ + @JsonProperty(value = "properties") + private PrivateDnsZoneGroupPropertiesFormat 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 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..58ab688b3f405 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupPropertiesFormat.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.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private dns zone group. */ +@Fluent +public final class PrivateDnsZoneGroupPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupPropertiesFormat.class); + + /* + * 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; + + /** + * 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..6973a9558138c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.RecordSet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private dns zone configuration resource. */ +@Fluent +public final class PrivateDnsZonePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZonePropertiesFormat.class); + + /* + * 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; + + /** + * 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..88e0d1d0b357a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.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.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.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpointConnection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * 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; + + /** + * 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..ce224d397fab1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionPropertiesInner.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.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionPropertiesInner.class); + + /* + * 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; + + /** + * 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..d5313b3b90fae --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Private endpoint resource. */ +@Fluent +public final class PrivateEndpointInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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; + + /** + * 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..eeb8a41f274e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointIpConfigurationProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of an IP Configuration of the private endpoint. */ +@Fluent +public final class PrivateEndpointIpConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointIpConfigurationProperties.class); + + /* + * 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; + + /** + * 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..4f29da7656676 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint. */ +@Fluent +public final class PrivateEndpointPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointPropertiesInner.class); + + /* + * 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; + + /** + * 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..51f1ef2fe4c90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.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.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the PrivateLinkServiceConnection. */ +@Fluent +public final class PrivateLinkServiceConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionProperties.class); + + /* + * 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; + + /** + * 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..6c8887211578b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Private link service resource. */ +@Fluent +public final class PrivateLinkServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceInner.class); + + /* + * The extended location of the load balancer. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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; + + /** + * 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..a98dee6226091 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private link service ip configuration. */ +@Fluent +public final class PrivateLinkServiceIpConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceIpConfigurationInner.class); + + /* + * 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; + + /** + * 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..c83f05a1ae190 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationPropertiesInner.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of private link service IP configuration. */ +@Fluent +public final class PrivateLinkServiceIpConfigurationPropertiesInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PrivateLinkServiceIpConfigurationPropertiesInner.class); + + /* + * 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; + + /** + * 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..857a90538f6af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private link service. */ +@Fluent +public final class PrivateLinkServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceProperties.class); + + /* + * 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; + + /** + * 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..53d12d1957ab6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class PrivateLinkServiceVisibilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceVisibilityInner.class); + + /* + * Private Link Service Visibility (True/False). + */ + @JsonProperty(value = "visible") + private Boolean visible; + + /** + * Get the visible property: Private Link Service Visibility (True/False). + * + * @return the visible value. + */ + public Boolean visible() { + return this.visible; + } + + /** + * Set the visible property: Private Link Service Visibility (True/False). + * + * @param visible the visible value to set. + * @return the PrivateLinkServiceVisibilityInner object itself. + */ + public PrivateLinkServiceVisibilityInner withVisible(Boolean visible) { + this.visible = visible; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java new file mode 100644 index 0000000000000..5934dd9232fd0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.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.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A load balancer probe. */ +@Fluent +public final class ProbeInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProbeInner.class); + + /* + * 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; + + /** + * 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 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..35e8e980e7727 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbePropertiesFormat.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.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Load balancer probe resource. */ +@Fluent +public final class ProbePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProbePropertiesFormat.class); + + /* + * 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 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; + + /** + * 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 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")); + } + } +} 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..d9d196935f105 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressMigrationPhase; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Public IP address resource. */ +@Fluent +public final class PublicIpAddressInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressInner.class); + + /* + * The extended location of the public ip address. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP address SKU. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /* + * 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; + + /** + * 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..c0c9c1b943bf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressPropertiesFormatInner.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP address properties. */ +@Fluent +public final class PublicIpAddressPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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/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..53eec9a549ced --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Public IP prefix resource. */ +@Fluent +public final class PublicIpPrefixInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixInner.class); + + /* + * The extended location of the public ip address. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The public IP prefix SKU. + */ + @JsonProperty(value = "sku") + private PublicIpPrefixSku sku; + + /* + * 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; + + /** + * 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..9089697107376 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixPropertiesFormatInner.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP prefix properties. */ +@Fluent +public final class PublicIpPrefixPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..71a062fc0e22d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.SingleQueryResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Query result. */ +@Fluent +public final class QueryResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryResultsInner.class); + + /* + * 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; + + /** + * 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..60d38bce2829f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of ResourceNavigationLink. */ +@Fluent +public final class ResourceNavigationLinkFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinkFormat.class); + + /* + * 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; + + /** + * 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..7b0be6da8eeb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ResourceNavigationLinks_List operation. */ +@Fluent +public final class ResourceNavigationLinksListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksListResultInner.class); + + /* + * The resource navigation links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The resource navigation links in a subnet. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The resource navigation links in a subnet. + * + * @param value the value value to set. + * @return the ResourceNavigationLinksListResultInner object itself. + */ + public ResourceNavigationLinksListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.java new file mode 100644 index 0000000000000..72ca713d3092b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route Filter Resource. */ +@Fluent +public final class RouteFilterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterInner.class); + + /* + * 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; + + /** + * 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..730cca344f753 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Resource. */ +@Fluent +public final class RouteFilterPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterPropertiesFormat.class); + + /* + * 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; + + /** + * 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..ce1821267dff4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Rule Resource. */ +@Fluent +public final class RouteFilterRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleInner.class); + + /* + * 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; + + /** + * 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..3b66048b22aab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRulePropertiesFormat.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Filter Rule Resource. */ +@Fluent +public final class RouteFilterRulePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..3404ed3a85ea0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route resource. */ +@Fluent +public final class RouteInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteInner.class); + + /* + * 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; + + /** + * 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/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..a768c2864b088 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Route resource. */ +@Fluent +public final class RoutePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..21544afcfe90e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Route table resource. */ +@Fluent +public final class RouteTableInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableInner.class); + + /* + * 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; + + /** + * 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..6dca96ff99b30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTablePropertiesFormat.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.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Route Table resource. */ +@Fluent +public final class RouteTablePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTablePropertiesFormat.class); + + /* + * 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; + + /** + * 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..adf6924c66caf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingIntentInner.class); + + /* + * 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; + + /** + * 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..b549e4fcd9aa6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a RoutingIntent resource. */ +@Fluent +public final class RoutingIntentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingIntentProperties.class); + + /* + * 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; + + /** + * 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/SecurityGroupViewResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java new file mode 100644 index 0000000000000..2624627a15a8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The information about security rules applied to the specified VM. */ +@Fluent +public final class SecurityGroupViewResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewResultInner.class); + + /* + * List of network interfaces on the specified VM. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Get the networkInterfaces property: List of network interfaces on the specified VM. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: List of network interfaces on the specified VM. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the SecurityGroupViewResultInner object itself. + */ + public SecurityGroupViewResultInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.java new file mode 100644 index 0000000000000..af3dbd42f43ed --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Security Partner Provider resource. */ +@Fluent +public final class SecurityPartnerProviderInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProviderInner.class); + + /* + * 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; + + /** + * 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..57e57e63e7a16 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Security Partner Provider. */ +@Fluent +public final class SecurityPartnerProviderPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProviderPropertiesFormat.class); + + /* + * 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; + + /** + * 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..932066632e871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRuleInner.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network security rule. */ +@Fluent +public final class SecurityRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleInner.class); + + /* + * 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; + + /** + * 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..98d9432491c89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRulePropertiesFormat.java @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Security rule resource. */ +@Fluent +public final class SecurityRulePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRulePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..6c7b5ec1b7b10 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of ServiceAssociationLink. */ +@Fluent +public final class ServiceAssociationLinkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinkPropertiesFormat.class); + + /* + * 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; + + /** + * 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..41b30c4f96ddc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ServiceAssociationLinks_List operation. */ +@Fluent +public final class ServiceAssociationLinksListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksListResultInner.class); + + /* + * The service association links in a subnet. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The service association links in a subnet. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The service association links in a subnet. + * + * @param value the value value to set. + * @return the ServiceAssociationLinksListResultInner object itself. + */ + public ServiceAssociationLinksListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..74b1582498e95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceDelegationPropertiesFormat.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a service delegation. */ +@Fluent +public final class ServiceDelegationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceDelegationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..f5bc2852cbb46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint policy definitions. */ +@Fluent +public final class ServiceEndpointPolicyDefinitionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionInner.class); + + /* + * 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; + + /** + * 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..546f3d4353d15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint policy definition resource. */ +@Fluent +public final class ServiceEndpointPolicyDefinitionPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionPropertiesFormat.class); + + /* + * 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; + + /** + * 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..d0be716a84f39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Service End point policy resource. */ +@Fluent +public final class ServiceEndpointPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyInner.class); + + /* + * 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; + + /** + * 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..16229eefba729 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyPropertiesFormat.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.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Endpoint Policy resource. */ +@Fluent +public final class ServiceEndpointPolicyPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyPropertiesFormat.class); + + /* + * 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; + + /** + * 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..0005519f842fa --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The service tag information. */ +@Immutable +public final class ServiceTagInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagInformationInner.class); + + /* + * Properties of the service tag information. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ServiceTagInformationPropertiesFormat properties; + + /* + * The name of service tag. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of service tag. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The iteration number of service tag object for region. + */ + @JsonProperty(value = "serviceTagChangeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serviceTagChangeNumber; + + /** + * 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..230c23d786700 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceTags API service call. */ +@Immutable +public final class ServiceTagsListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagsListResultInner.class); + + /* + * The name of the cloud. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The ID of the cloud. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The azure resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The name of the cloud. + */ + @JsonProperty(value = "cloud", access = JsonProperty.Access.WRITE_ONLY) + private String cloud; + + /* + * The list of service tag information resources. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The URL to get next page of service tag information resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the name property: The name of the cloud. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The ID of the cloud. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: The azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Get the cloud property: The name of the cloud. + * + * @return the cloud value. + */ + public String cloud() { + return this.cloud; + } + + /** + * Get the values property: The list of service tag information resources. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the nextLink property: The URL to get next page of service tag information resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..093c171501dff --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignatureOverridesFilterValuesResponseInner.class); + + /* + * Describes the possible values + */ + @JsonProperty(value = "filterValues") + private List filterValues; + + /** + * 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..85b14300f4a2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.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.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains all specific policy signatures overrides for the IDPS. */ +@Fluent +public final class SignaturesOverridesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignaturesOverridesInner.class); + + /* + * 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; + + /** + * 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..2ba63870e5374 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an object containing an array with a single item. */ +@Fluent +public final class SignaturesOverridesListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignaturesOverridesListInner.class); + + /* + * Describes a list consisting exactly one item describing the policy's + * signature override status + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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/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..21a619fbf6749 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet in a virtual network resource. */ +@Fluent +public final class SubnetInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetInner.class); + + /* + * 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; + + /** + * 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..8eb1f7bd58dab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetPropertiesFormatInner.java @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the subnet. */ +@Fluent +public final class SubnetPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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/TopologyInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.java new file mode 100644 index 0000000000000..e238779d72487 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.TopologyResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Topology of the specified resource group. */ +@Fluent +public final class TopologyInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyInner.class); + + /* + * GUID representing the operation id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The datetime when the topology was initially created for the resource + * group. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The datetime when the topology was last modified. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * A list of topology resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get the id property: GUID representing the operation id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the createdDateTime property: The datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastModified property: The datetime when the topology was last modified. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the resources property: A list of topology resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: A list of topology resources. + * + * @param resources the resources value to set. + * @return the TopologyInner object itself. + */ + public TopologyInner withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resources() != null) { + resources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..ec683d7fa945a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingProperties.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage location provided for troubleshoot. */ +@Fluent +public final class TroubleshootingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingProperties.class); + + /* + * 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; + + /** + * 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")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java new file mode 100644 index 0000000000000..64364e1fabd6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Troubleshooting information gained from specified resource. */ +@Fluent +public final class TroubleshootingResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingResultInner.class); + + /* + * The start time of the troubleshooting. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the troubleshooting. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The result code of the troubleshooting. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Information from troubleshooting. + */ + @JsonProperty(value = "results") + private List results; + + /** + * Get the startTime property: The start time of the troubleshooting. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the troubleshooting. + * + * @param startTime the startTime value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the troubleshooting. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the troubleshooting. + * + * @param endTime the endTime value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the code property: The result code of the troubleshooting. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The result code of the troubleshooting. + * + * @param code the code value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the results property: Information from troubleshooting. + * + * @return the results value. + */ + public List results() { + return this.results; + } + + /** + * Set the results property: Information from troubleshooting. + * + * @param results the results value to set. + * @return the TroubleshootingResultInner object itself. + */ + public TroubleshootingResultInner withResults(List results) { + this.results = results; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (results() != null) { + results().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..4f7049a01ce05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network resource usage. */ +@Fluent +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * Resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * An enum describing the unit of measurement. + */ + @JsonProperty(value = "unit", required = true) + private UsageUnit unit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue", required = true) + private long currentValue; + + /* + * The limit of usage. + */ + @JsonProperty(value = "limit", required = true) + private long limit; + + /* + * The name of the type of usage. + */ + @JsonProperty(value = "name", required = true) + private UsageName name; + + /** + * Get the id property: Resource identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: An enum describing the unit of measurement. + * + * @param unit the unit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the usage. + * + * @param currentValue the currentValue value to set. + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The limit of usage. + * + * @return the limit value. + */ + public long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit of usage. + * + * @param limit the limit value to set. + * @return the UsageInner object itself. + */ + public UsageInner withLimit(long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Set the name property: The name of the type of usage. + * + * @param name the name value to set. + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (unit() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java new file mode 100644 index 0000000000000..877c967089594 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Access; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Results of IP flow verification on the target resource. */ +@Fluent +public final class VerificationIpFlowResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowResultInner.class); + + /* + * Indicates whether the traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private Access access; + + /* + * Name of the rule. If input is not matched against any security rule, it + * is not displayed. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /** + * Get the access property: Indicates whether the traffic is allowed or denied. + * + * @return the access value. + */ + public Access access() { + return this.access; + } + + /** + * Set the access property: Indicates whether the traffic is allowed or denied. + * + * @param access the access value to set. + * @return the VerificationIpFlowResultInner object itself. + */ + public VerificationIpFlowResultInner withAccess(Access access) { + this.access = access; + return this; + } + + /** + * Get the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @param ruleName the ruleName value to set. + * @return the VerificationIpFlowResultInner object itself. + */ + public VerificationIpFlowResultInner withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.java new file mode 100644 index 0000000000000..5a4cd27d43902 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Appliance Site resource. */ +@Fluent +public final class VirtualApplianceSiteInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSiteInner.class); + + /* + * 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; + + /** + * 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..e99a9485240fe --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the rule group. */ +@Fluent +public final class VirtualApplianceSiteProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSiteProperties.class); + + /* + * 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; + + /** + * 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..cbdbde9173111 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.PreferredRoutingGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualHub Resource. */ +@Fluent +public final class VirtualHubInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubInner.class); + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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..c55c6348267c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubProperties.java @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.PreferredRoutingGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualHub. */ +@Fluent +public final class VirtualHubProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubProperties.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routeTable() != null) { + routeTable().validate(); + } + if (virtualHubRouteTableV2S() != null) { + virtualHubRouteTableV2S().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.java new file mode 100644 index 0000000000000..92c882ebe76e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.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.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubRouteTableV2 Resource. */ +@Fluent +public final class VirtualHubRouteTableV2Inner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2Inner.class); + + /* + * 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; + + /** + * 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..c8634808686f2 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualHubRouteTableV2. */ +@Fluent +public final class VirtualHubRouteTableV2Properties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2Properties.class); + + /* + * 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; + + /** + * 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..607ff863bd57c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@Fluent +public final class VirtualNetworkGatewayConnectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionInner.class); + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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(); + } + } +} 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..a4fd1ec0e70a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkConnectionGatewayReference; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListEntityInner.class); + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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(); + } + } +} 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..ead85148af70c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java @@ -0,0 +1,560 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkConnectionGatewayReference; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayConnection properties. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListEntityPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(VirtualNetworkGatewayConnectionListEntityPropertiesFormat.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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 (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..a2dd3a67265ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java @@ -0,0 +1,662 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayConnection properties. */ +@Fluent +public final class VirtualNetworkGatewayConnectionPropertiesFormatInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionPropertiesFormatInner.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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 (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java new file mode 100644 index 0000000000000..3be26f4e1ecb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnGatewayGeneration; +import com.azure.resourcemanager.network.generated.models.VpnType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A common class for general resource information. */ +@Fluent +public final class VirtualNetworkGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayInner.class); + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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(); + } + } +} 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..d975cda577414 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of VirtualNetworkGatewayIPConfiguration. */ +@Fluent +public final class VirtualNetworkGatewayIpConfigurationPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayIpConfigurationPropertiesFormat.class); + + /* + * 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; + + /** + * 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..d36707e67382a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGatewayNatRule Resource. */ +@Fluent +public final class VirtualNetworkGatewayNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRuleInner.class); + + /* + * 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; + + /** + * 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..e07bcff554cc9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualNetworkGatewayNatRule. */ +@Fluent +public final class VirtualNetworkGatewayNatRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRuleProperties.class); + + /* + * 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; + + /** + * 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/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..545bdad7b730e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.java @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnGatewayGeneration; +import com.azure.resourcemanager.network.generated.models.VpnType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualNetworkGateway properties. */ +@Fluent +public final class VirtualNetworkGatewayPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayPropertiesFormat.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * 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 (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..122186a8f3953 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Virtual Network resource. */ +@Fluent +public final class VirtualNetworkInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkInner.class); + + /* + * The extended location of the virtual network. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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; + + /** + * 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; + } + + /** + * 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..0d8a18ee6566f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peerings in a virtual network resource. */ +@Fluent +public final class VirtualNetworkPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringInner.class); + + /* + * 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; + + /** + * 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..06ba7197b20e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringPropertiesFormat.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.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the virtual network peering. */ +@Fluent +public final class VirtualNetworkPeeringPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringPropertiesFormat.class); + + /* + * 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; + + /** + * 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..e01ddd34932a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the virtual network. */ +@Fluent +public final class VirtualNetworkPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPropertiesFormat.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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(); + } + } +} 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..366c709a5bd1c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Virtual Network Tap resource. */ +@Fluent +public final class VirtualNetworkTapInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapInner.class); + + /* + * 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; + + /** + * 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..c20a3ab81d92e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapPropertiesFormatInner.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.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Virtual Network Tap properties. */ +@Fluent +public final class VirtualNetworkTapPropertiesFormatInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapPropertiesFormatInner.class); + + /* + * 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; + + /** + * 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..45bfb812237a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Usage details for subnet. */ +@Immutable +public final class VirtualNetworkUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageInner.class); + + /* + * Indicates number of IPs used from the Subnet. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /* + * Subnet identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Indicates the size of the subnet. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /* + * The name containing common and localized value for usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkUsageName name; + + /* + * Usage units. Returns 'Count'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * Get the currentValue property: Indicates number of IPs used from the Subnet. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the id property: Subnet identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the limit property: Indicates the size of the subnet. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Get the name property: The name containing common and localized value for usage. + * + * @return the name value. + */ + public VirtualNetworkUsageName name() { + return this.name; + } + + /** + * Get the unit property: Usage units. Returns 'Count'. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java new file mode 100644 index 0000000000000..529fcad215db9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualRouter Resource. */ +@Fluent +public final class VirtualRouterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterInner.class); + + /* + * 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; + + /** + * 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..fcea9e203b69f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Router Peering resource. */ +@Fluent +public final class VirtualRouterPeeringInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringInner.class); + + /* + * 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; + + /** + * 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..988ac595de92b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the rule group. */ +@Fluent +public final class VirtualRouterPeeringProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringProperties.class); + + /* + * 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; + + /** + * 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..aa33be1fa7de8 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Virtual Router definition. */ +@Fluent +public final class VirtualRouterPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPropertiesFormat.class); + + /* + * 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; + + /** + * 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..279afa971bdf4 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualWAN Resource. */ +@Fluent +public final class VirtualWanInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanInner.class); + + /* + * 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; + + /** + * 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..3a64190d58976 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VirtualWAN. */ +@Fluent +public final class VirtualWanProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanProperties.class); + + /* + * 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; + + /** + * 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..a9e0d37949582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvidersInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvidersInner.class); + + /* + * List of VirtualWAN security providers. + */ + @JsonProperty(value = "supportedProviders") + private List supportedProviders; + + /** + * Get the supportedProviders property: List of VirtualWAN security providers. + * + * @return the supportedProviders value. + */ + public List supportedProviders() { + return this.supportedProviders; + } + + /** + * Set the supportedProviders property: List of VirtualWAN security providers. + * + * @param supportedProviders the supportedProviders value to set. + * @return the VirtualWanSecurityProvidersInner object itself. + */ + public VirtualWanSecurityProvidersInner withSupportedProviders( + List supportedProviders) { + this.supportedProviders = supportedProviders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedProviders() != null) { + supportedProviders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java new file mode 100644 index 0000000000000..57d9bc777b2ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of virtual network gateway vpn client connection health. */ +@Fluent +public final class VpnClientConnectionHealthDetailListResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealthDetailListResultInner.class); + + /* + * List of vpn client connection health. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of vpn client connection health. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of vpn client connection health. + * + * @param value the value value to set. + * @return the VpnClientConnectionHealthDetailListResultInner object itself. + */ + public VpnClientConnectionHealthDetailListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java new file mode 100644 index 0000000000000..0424a27575b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IPSec parameters for a virtual network gateway P2S connection. */ +@Fluent +public final class VpnClientIPsecParametersInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientIPsecParametersInner.class); + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value. + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value. + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @param ipsecEncryption the ipsecEncryption value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @param ipsecIntegrity the ipsecIntegrity value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @param ikeEncryption the ikeEncryption value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @param ikeIntegrity the ikeIntegrity value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @param dhGroup the dhGroup value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @param pfsGroup the pfsGroup value to set. + * @return the VpnClientIPsecParametersInner object itself. + */ + public VpnClientIPsecParametersInner withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecEncryption in model VpnClientIPsecParametersInner")); + } + if (ipsecIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipsecIntegrity in model VpnClientIPsecParametersInner")); + } + if (ikeEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeEncryption in model VpnClientIPsecParametersInner")); + } + if (ikeIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ikeIntegrity in model VpnClientIPsecParametersInner")); + } + if (dhGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dhGroup in model VpnClientIPsecParametersInner")); + } + if (pfsGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property pfsGroup in model VpnClientIPsecParametersInner")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/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..bba136f7b5bed --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the revoked VPN client certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRevokedCertificatePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRevokedCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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..4b2bc010d5315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of SSL certificates of application gateway. */ +@Fluent +public final class VpnClientRootCertificatePropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRootCertificatePropertiesFormat.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..b85e251b8ad91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnConnection Resource. */ +@Fluent +public final class VpnConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionInner.class); + + /* + * 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; + + /** + * 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..f9f433090015f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionProperties.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnConnection. */ +@Fluent +public final class VpnConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionProperties.class); + + /* + * 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; + + /** + * 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..64eb6871f8c64 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnGateway Resource. */ +@Fluent +public final class VpnGatewayInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayInner.class); + + /* + * 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; + + /** + * 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..378935f5a6ecb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.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.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.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnGatewayNatRule Resource. */ +@Fluent +public final class VpnGatewayNatRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayNatRuleInner.class); + + /* + * 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; + + /** + * 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..064ea74182cbe --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnGatewayNatRule. */ +@Fluent +public final class VpnGatewayNatRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayNatRuleProperties.class); + + /* + * 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; + + /** + * 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..326f165623d34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.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.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.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayIpConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnGateway. */ +@Fluent +public final class VpnGatewayProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayProperties.class); + + /* + * 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; + + /** + * 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..870cc0035b8fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn Profile Response for package generation. */ +@Fluent +public final class VpnProfileResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnProfileResponseInner.class); + + /* + * URL to the VPN profile. + */ + @JsonProperty(value = "profileUrl") + private String profileUrl; + + /** + * Get the profileUrl property: URL to the VPN profile. + * + * @return the profileUrl value. + */ + public String profileUrl() { + return this.profileUrl; + } + + /** + * Set the profileUrl property: URL to the VPN profile. + * + * @param profileUrl the profileUrl value to set. + * @return the VpnProfileResponseInner object itself. + */ + public VpnProfileResponseInner withProfileUrl(String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java new file mode 100644 index 0000000000000..80c92dfe30484 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnServerConfiguration Resource. */ +@Fluent +public final class VpnServerConfigurationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationInner.class); + + /* + * 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; + + /** + * 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 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/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..3343b9b3af72e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationProperties.class); + + /* + * 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; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * 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 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java new file mode 100644 index 0000000000000..685b9ac2aff38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnServerConfigurations list associated with VirtualWan Response. */ +@Fluent +public final class VpnServerConfigurationsResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsResponseInner.class); + + /* + * List of VpnServerConfigurations associated with VirtualWan. + */ + @JsonProperty(value = "vpnServerConfigurationResourceIds") + private List vpnServerConfigurationResourceIds; + + /** + * Get the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @return the vpnServerConfigurationResourceIds value. + */ + public List vpnServerConfigurationResourceIds() { + return this.vpnServerConfigurationResourceIds; + } + + /** + * Set the vpnServerConfigurationResourceIds property: List of VpnServerConfigurations associated with VirtualWan. + * + * @param vpnServerConfigurationResourceIds the vpnServerConfigurationResourceIds value to set. + * @return the VpnServerConfigurationsResponseInner object itself. + */ + public VpnServerConfigurationsResponseInner withVpnServerConfigurationResourceIds( + List vpnServerConfigurationResourceIds) { + this.vpnServerConfigurationResourceIds = vpnServerConfigurationResourceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.java new file mode 100644 index 0000000000000..f68cfc16e7420 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VpnSite Resource. */ +@Fluent +public final class VpnSiteInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteInner.class); + + /* + * 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; + + /** + * 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..eb17736d0444c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by 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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnSiteLinkConnection Resource. */ +@Fluent +public final class VpnSiteLinkConnectionInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionInner.class); + + /* + * 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; + + /** + * 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 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..a334a8bd160a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionProperties.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnConnection. */ +@Fluent +public final class VpnSiteLinkConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionProperties.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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 (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..b89928e205a6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.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.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VpnSiteLink Resource. */ +@Fluent +public final class VpnSiteLinkInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkInner.class); + + /* + * 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; + + /** + * 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..237520c920929 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for VpnSite. */ +@Fluent +public final class VpnSiteLinkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkProperties.class); + + /* + * 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; + + /** + * 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..374167c64b381 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for VpnSite. */ +@Fluent +public final class VpnSiteProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteProperties.class); + + /* + * 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; + + /** + * 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..4b03047d07b4b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Defines web application firewall policy. */ +@Fluent +public final class WebApplicationFirewallPolicyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyInner.class); + + /* + * 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; + + /** + * 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..00ca6fd9dc388 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyPropertiesFormat.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines web application firewall policy properties. */ +@Fluent +public final class WebApplicationFirewallPolicyPropertiesFormat { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyPropertiesFormat.class); + + /* + * 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; + + /** + * 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..00c2078cc0bd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java new file mode 100644 index 0000000000000..441007dd96a3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.fluent; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.java new file mode 100644 index 0000000000000..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..0161559a5cd7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,673 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAuthenticationCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAutoscaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +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.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 httpListeners() { + List inner = this.innerModel().httpListeners(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sslProfiles() { + List inner = this.innerModel().sslProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List urlPathMaps() { + List inner = this.innerModel().urlPathMaps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requestRoutingRules() { + List inner = this.innerModel().requestRoutingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List rewriteRuleSets() { + List inner = this.innerModel().rewriteRuleSets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List redirectConfigurations() { + List inner = this.innerModel().redirectConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.innerModel().webApplicationFirewallConfiguration(); + } + + public SubResource firewallPolicy() { + return this.innerModel().firewallPolicy(); + } + + public Boolean enableHttp2() { + return this.innerModel().enableHttp2(); + } + + public Boolean enableFips() { + return this.innerModel().enableFips(); + } + + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.innerModel().autoscaleConfiguration(); + } + + public List privateLinkConfigurations() { + List inner = this.innerModel().privateLinkConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List customErrorConfigurations() { + List inner = this.innerModel().customErrorConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean forceFirewallPolicyAssociation() { + return this.innerModel().forceFirewallPolicyAssociation(); + } + + public 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 ApplicationGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String applicationGatewayName; + + private TagsObject updateParameters; + + public ApplicationGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApplicationGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .createOrUpdate(resourceGroupName, applicationGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .createOrUpdate(resourceGroupName, applicationGatewayName, this.innerModel(), context); + return this; + } + + ApplicationGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ApplicationGatewayInner(); + this.serviceManager = serviceManager; + this.applicationGatewayName = name; + } + + public ApplicationGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ApplicationGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .updateTagsWithResponse(resourceGroupName, applicationGatewayName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApplicationGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .updateTagsWithResponse(resourceGroupName, applicationGatewayName, updateParameters, context) + .getValue(); + return this; + } + + ApplicationGatewayImpl( + ApplicationGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGatewayName = Utils.getValueFromIdByName(innerObject.id(), "applicationGateways"); + } + + public ApplicationGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationGateways() + .getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName); + } + + public void start(Context context) { + serviceManager.applicationGateways().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop() { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(Context context) { + serviceManager.applicationGateways().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth(String expand) { + return serviceManager.applicationGateways().backendHealth(resourceGroupName, applicationGatewayName, expand); + } + + public ApplicationGatewayBackendHealth backendHealth() { + return serviceManager.applicationGateways().backendHealth(resourceGroupName, applicationGatewayName); + } + + public ApplicationGatewayBackendHealth backendHealth(String expand, Context context) { + return serviceManager + .applicationGateways() + .backendHealth(resourceGroupName, applicationGatewayName, expand, context); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand(ApplicationGatewayOnDemandProbe probeRequest) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest); + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) { + return serviceManager + .applicationGateways() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand, context); + } + + public ApplicationGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplicationGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplicationGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplicationGatewayImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ApplicationGatewayImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ApplicationGatewayImpl withSku(ApplicationGatewaySku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ApplicationGatewayImpl withSslPolicy(ApplicationGatewaySslPolicy sslPolicy) { + this.innerModel().withSslPolicy(sslPolicy); + return this; + } + + public ApplicationGatewayImpl withGatewayIpConfigurations( + List gatewayIpConfigurations) { + this.innerModel().withGatewayIpConfigurations(gatewayIpConfigurations); + return this; + } + + public ApplicationGatewayImpl withAuthenticationCertificates( + List authenticationCertificates) { + this.innerModel().withAuthenticationCertificates(authenticationCertificates); + return this; + } + + public ApplicationGatewayImpl withTrustedRootCertificates( + List trustedRootCertificates) { + this.innerModel().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + public ApplicationGatewayImpl withTrustedClientCertificates( + List trustedClientCertificates) { + this.innerModel().withTrustedClientCertificates(trustedClientCertificates); + return this; + } + + public ApplicationGatewayImpl withSslCertificates(List sslCertificates) { + this.innerModel().withSslCertificates(sslCertificates); + return this; + } + + public ApplicationGatewayImpl withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.innerModel().withFrontendIpConfigurations(frontendIpConfigurations); + return this; + } + + public ApplicationGatewayImpl withFrontendPorts(List frontendPorts) { + this.innerModel().withFrontendPorts(frontendPorts); + return this; + } + + public ApplicationGatewayImpl withProbes(List probes) { + this.innerModel().withProbes(probes); + return this; + } + + public ApplicationGatewayImpl withBackendAddressPools( + List backendAddressPools) { + this.innerModel().withBackendAddressPools(backendAddressPools); + return this; + } + + public ApplicationGatewayImpl withBackendHttpSettingsCollection( + List backendHttpSettingsCollection) { + this.innerModel().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.innerModel().withHttpListeners(httpListeners); + return this; + } + + public ApplicationGatewayImpl withSslProfiles(List sslProfiles) { + this.innerModel().withSslProfiles(sslProfiles); + return this; + } + + public ApplicationGatewayImpl withUrlPathMaps(List urlPathMaps) { + this.innerModel().withUrlPathMaps(urlPathMaps); + return this; + } + + public ApplicationGatewayImpl withRequestRoutingRules( + List requestRoutingRules) { + this.innerModel().withRequestRoutingRules(requestRoutingRules); + return this; + } + + public ApplicationGatewayImpl withRewriteRuleSets(List rewriteRuleSets) { + this.innerModel().withRewriteRuleSets(rewriteRuleSets); + return this; + } + + public ApplicationGatewayImpl withRedirectConfigurations( + List redirectConfigurations) { + this.innerModel().withRedirectConfigurations(redirectConfigurations); + return this; + } + + public ApplicationGatewayImpl withWebApplicationFirewallConfiguration( + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration) { + this.innerModel().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + public ApplicationGatewayImpl withFirewallPolicy(SubResource firewallPolicy) { + this.innerModel().withFirewallPolicy(firewallPolicy); + return this; + } + + public ApplicationGatewayImpl withEnableHttp2(Boolean enableHttp2) { + this.innerModel().withEnableHttp2(enableHttp2); + return this; + } + + public ApplicationGatewayImpl withEnableFips(Boolean enableFips) { + this.innerModel().withEnableFips(enableFips); + return this; + } + + public ApplicationGatewayImpl withAutoscaleConfiguration( + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + this.innerModel().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + public ApplicationGatewayImpl withPrivateLinkConfigurations( + List privateLinkConfigurations) { + this.innerModel().withPrivateLinkConfigurations(privateLinkConfigurations); + return this; + } + + public ApplicationGatewayImpl withCustomErrorConfigurations( + List customErrorConfigurations) { + this.innerModel().withCustomErrorConfigurations(customErrorConfigurations); + return this; + } + + public ApplicationGatewayImpl withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation) { + this.innerModel().withForceFirewallPolicyAssociation(forceFirewallPolicyAssociation); + return this; + } + + 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..c873b9921c1c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateEndpointConnectionsClient. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsClientImpl + implements ApplicationGatewayPrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewayPrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayPrivateEndpointConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationGatewayPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayPrivateEndpointConnections + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewayPrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationGatewayPrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters).getSyncPoller(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, applicationGatewayName, connectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayPrivateEndpointConnectionInner get( + String resourceGroupName, String applicationGatewayName, String connectionName) { + return getAsync(resourceGroupName, applicationGatewayName, connectionName).block(); + } + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName)); + } + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..28887d77c84ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationGatewayPrivateEndpointConnectionsImpl + implements ApplicationGatewayPrivateEndpointConnections { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionsImpl.class); + + private final ApplicationGatewayPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayPrivateEndpointConnectionsImpl( + ApplicationGatewayPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String applicationGatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, connectionName); + } + + public void delete( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, connectionName, context); + } + + public ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, applicationGatewayName, connectionName, parameters); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, applicationGatewayName, connectionName, parameters, context); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayPrivateEndpointConnection get( + String resourceGroupName, String applicationGatewayName, String connectionName) { + ApplicationGatewayPrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, applicationGatewayName, connectionName); + if (inner != null) { + return new ApplicationGatewayPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, applicationGatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayPrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName); + return Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new ApplicationGatewayPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..e1c4e71149df5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayPrivateLinkResourceImpl implements ApplicationGatewayPrivateLinkResource { + private ApplicationGatewayPrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateLinkResourceImpl( + ApplicationGatewayPrivateLinkResourceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayPrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..4298b3d935ec2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayPrivateLinkResourcesClient. + */ +public final class ApplicationGatewayPrivateLinkResourcesClientImpl + implements ApplicationGatewayPrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewayPrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayPrivateLinkResourcesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationGatewayPrivateLinkResourcesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayPrivateLinkResources to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewayPrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, applicationGatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName)); + } + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, applicationGatewayName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..eba00c968004d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationGatewayPrivateLinkResourcesImpl implements ApplicationGatewayPrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourcesImpl.class); + + private final ApplicationGatewayPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayPrivateLinkResourcesImpl( + ApplicationGatewayPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, applicationGatewayName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayPrivateLinkResourceImpl(inner1, this.manager())); + } + + private ApplicationGatewayPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java new file mode 100644 index 0000000000000..a68017909ed0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPredefinedPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaySslPredefinedPolicyImpl implements ApplicationGatewaySslPredefinedPolicy { + private ApplicationGatewaySslPredefinedPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewaySslPredefinedPolicyImpl( + ApplicationGatewaySslPredefinedPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public List cipherSuites() { + List inner = this.innerModel().cipherSuites(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.innerModel().minProtocolVersion(); + } + + public ApplicationGatewaySslPredefinedPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java new file mode 100644 index 0000000000000..b9c8b2ab25e90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java @@ -0,0 +1,3746 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslPredefinedPolicies; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayListResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationGatewaysClient. */ +public final class ApplicationGatewaysClientImpl implements ApplicationGatewaysClient { + private final ClientLogger logger = new ClientLogger(ApplicationGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationGatewaysService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/backendhealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backendHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backendHealthOnDemand( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationGatewayName") String applicationGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @BodyParam("application/json") ApplicationGatewayOnDemandProbe probeRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableServerVariables( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableRequestHeaders( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> listAvailableResponseHeaders( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableWafRuleSets( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSslOptions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" + + "/predefinedPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSslPredefinedPolicies( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" + + "/predefinedPolicies/{predefinedPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSslPredefinedPolicy( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("predefinedPolicyName") String predefinedPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableSslPredefinedPoliciesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupAsync(resourceGroupName, applicationGatewayName).block(); + } + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName, context).block(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to the create or update application gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayInner updateTags( + String resourceGroupName, String applicationGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, applicationGatewayName, parameters).block(); + } + + /** + * Updates the specified application gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param parameters Parameters supplied to update application gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application gateway resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the application gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName) { + return beginStartAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String applicationGatewayName, Context context) { + return beginStartAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName) { + return beginStopAsync(resourceGroupName, applicationGatewayName).getSyncPoller(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String applicationGatewayName, Context context) { + return beginStopAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller(); + } + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backendHealth( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).getSyncPoller(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).getSyncPoller(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group 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. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand) { + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) { + final String expand = null; + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block(); + } + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthInner backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return backendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backendHealthOnDemand( + this.client.getEndpoint(), + resourceGroupName, + applicationGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + probeRequest, + accept, + context); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand) + .getSyncPoller(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context) + .getSyncPoller(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group 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. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + final String expand = null; + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).block(); + } + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context) + .block(); + } + + /** + * Lists all available server variables. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call 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 = "2021-08-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 = "2021-08-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( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available server variables. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableServerVariables() { + return listAvailableServerVariablesAsync().block(); + } + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableServerVariablesWithResponse(Context context) { + return listAvailableServerVariablesWithResponseAsync(context).block(); + } + + /** + * Lists all available request headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call 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 = "2021-08-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 = "2021-08-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( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available request headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableRequestHeaders() { + return listAvailableRequestHeadersAsync().block(); + } + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return listAvailableRequestHeadersWithResponseAsync(context).block(); + } + + /** + * Lists all available response headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call 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 = "2021-08-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 = "2021-08-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( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available response headers. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listAvailableResponseHeaders() { + return listAvailableResponseHeadersAsync().block(); + } + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return listAvailableResponseHeadersWithResponseAsync(context).block(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all available web application firewall rule sets. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsAsync().block(); + } + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableWafRuleSetsWithResponse( + Context context) { + return listAvailableWafRuleSetsWithResponseAsync(context).block(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsAsync().block(); + } + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableSslOptionsWithResponse(Context context) { + return listAvailableSslOptionsWithResponseAsync(context).block(); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableSslPredefinedPolicies( + this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSslPredefinedPoliciesAsync() { + return new PagedFlux<>( + () -> listAvailableSslPredefinedPoliciesSinglePageAsync(), + nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableSslPredefinedPoliciesAsync( + Context context) { + return new PagedFlux<>( + () -> listAvailableSslPredefinedPoliciesSinglePageAsync(context), + nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSslPredefinedPolicies() { + return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync()); + } + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableSslPredefinedPolicies( + Context context) { + return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync(context)); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) { + return getSslPredefinedPolicyAsync(predefinedPolicyName).block(); + } + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context) { + return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..f835b4d4c636c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableSslOptionsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableSslOptions; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayAvailableWafRuleSetsResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealth; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthOnDemand; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPredefinedPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaysImpl implements ApplicationGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaysImpl.class); + + private final ApplicationGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewaysImpl( + ApplicationGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName); + } + + public void delete(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGateway getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationGatewayName); + if (inner != null) { + return new ApplicationGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().start(resourceGroupName, applicationGatewayName); + } + + public void start(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().start(resourceGroupName, applicationGatewayName, context); + } + + public void stop(String resourceGroupName, String applicationGatewayName) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName); + } + + public void stop(String resourceGroupName, String applicationGatewayName, Context context) { + this.serviceClient().stop(resourceGroupName, applicationGatewayName, context); + } + + public ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName, expand); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealth backendHealth(String resourceGroupName, String applicationGatewayName) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context) { + ApplicationGatewayBackendHealthInner inner = + this.serviceClient().backendHealth(resourceGroupName, applicationGatewayName, expand, context); + if (inner != null) { + return new ApplicationGatewayBackendHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this.serviceClient().backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this.serviceClient().backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context) { + ApplicationGatewayBackendHealthOnDemandInner inner = + this + .serviceClient() + .backendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, expand, context); + if (inner != null) { + return new ApplicationGatewayBackendHealthOnDemandImpl(inner, this.manager()); + } else { + return null; + } + } + + public List listAvailableServerVariables() { + List inner = this.serviceClient().listAvailableServerVariables(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableServerVariablesWithResponse(Context context) { + return this.serviceClient().listAvailableServerVariablesWithResponse(context); + } + + public List listAvailableRequestHeaders() { + List inner = this.serviceClient().listAvailableRequestHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableRequestHeadersWithResponse(context); + } + + public List listAvailableResponseHeaders() { + List inner = this.serviceClient().listAvailableResponseHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableResponseHeadersWithResponse(context); + } + + public ApplicationGatewayAvailableWafRuleSetsResult listAvailableWafRuleSets() { + ApplicationGatewayAvailableWafRuleSetsResultInner inner = this.serviceClient().listAvailableWafRuleSets(); + if (inner != null) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAvailableWafRuleSetsWithResponse( + Context context) { + Response inner = + this.serviceClient().listAvailableWafRuleSetsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayAvailableWafRuleSetsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationGatewayAvailableSslOptions listAvailableSslOptions() { + ApplicationGatewayAvailableSslOptionsInner inner = this.serviceClient().listAvailableSslOptions(); + if (inner != null) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAvailableSslOptionsWithResponse(Context context) { + Response inner = + this.serviceClient().listAvailableSslOptionsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewayAvailableSslOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listAvailableSslPredefinedPolicies() { + PagedIterable inner = + this.serviceClient().listAvailableSslPredefinedPolicies(); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSslPredefinedPolicies(Context context) { + PagedIterable inner = + this.serviceClient().listAvailableSslPredefinedPolicies(context); + return Utils.mapPage(inner, inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public ApplicationGatewaySslPredefinedPolicy getSslPredefinedPolicy(String predefinedPolicyName) { + ApplicationGatewaySslPredefinedPolicyInner inner = + this.serviceClient().getSslPredefinedPolicy(predefinedPolicyName); + if (inner != null) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context) { + Response inner = + this.serviceClient().getSslPredefinedPolicyWithResponse(predefinedPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationGatewaySslPredefinedPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = Utils.getValueFromIdByName(id, "applicationGateways"); + if (applicationGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationGateways'.", id))); + } + this.delete(resourceGroupName, applicationGatewayName, context); + } + + private ApplicationGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationGatewayImpl define(String name) { + return new ApplicationGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java new file mode 100644 index 0000000000000..9953d7d3c494f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ApplicationSecurityGroupImpl + implements ApplicationSecurityGroup, ApplicationSecurityGroup.Definition, ApplicationSecurityGroup.Update { + private ApplicationSecurityGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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..d46a9d3963fbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java @@ -0,0 +1,1516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApplicationSecurityGroupsClient. */ +public final class ApplicationSecurityGroupsClientImpl implements ApplicationSecurityGroupsClient { + private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationSecurityGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationSecurityGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationSecurityGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ApplicationSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationSecurityGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ApplicationSecurityGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApplicationSecurityGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups/{applicationSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("applicationSecurityGroupName") String applicationSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/applicationSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName).getSyncPoller(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, applicationSecurityGroupName, context).getSyncPoller(); + } + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner getByResourceGroup( + String resourceGroupName, String applicationSecurityGroupName) { + return getByResourceGroupAsync(resourceGroupName, applicationSecurityGroupName).block(); + } + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName, context).block(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + applicationSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String applicationSecurityGroupName, + ApplicationSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, applicationSecurityGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationSecurityGroupInner updateTags( + String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, applicationSecurityGroupName, parameters).block(); + } + + /** + * Updates an application security group's tags. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param parameters Parameters supplied to update application security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an application security group in a resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all application security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all application security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all application security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..6c8b7ae708867 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationSecurityGroupsImpl implements ApplicationSecurityGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupsImpl.class); + + private final ApplicationSecurityGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationSecurityGroupsImpl( + ApplicationSecurityGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + this.serviceClient().delete(resourceGroupName, applicationSecurityGroupName); + } + + public void delete(String resourceGroupName, String applicationSecurityGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, applicationSecurityGroupName, context); + } + + public ApplicationSecurityGroup getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName) { + ApplicationSecurityGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, applicationSecurityGroupName); + if (inner != null) { + return new ApplicationSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationSecurityGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public ApplicationSecurityGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName = Utils.getValueFromIdByName(id, "applicationSecurityGroups"); + if (applicationSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, applicationSecurityGroupName, context); + } + + private ApplicationSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ApplicationSecurityGroupImpl define(String name) { + return new ApplicationSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..fc9826a6caa60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkService; + +public final class AutoApprovedPrivateLinkServiceImpl implements AutoApprovedPrivateLinkService { + private AutoApprovedPrivateLinkServiceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AutoApprovedPrivateLinkServiceImpl( + AutoApprovedPrivateLinkServiceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String privateLinkService() { + return this.innerModel().privateLinkService(); + } + + public AutoApprovedPrivateLinkServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java new file mode 100644 index 0000000000000..7f88baceebc23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import java.util.Collections; +import java.util.List; + +public final class AvailableDelegationImpl implements AvailableDelegation { + private AvailableDelegationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableDelegationImpl( + AvailableDelegationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String serviceName() { + return this.innerModel().serviceName(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableDelegationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java new file mode 100644 index 0000000000000..12a6214abef68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegationsResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableDelegationsClient. */ +public final class AvailableDelegationsClientImpl implements AvailableDelegationsClient { + private final ClientLogger logger = new ClientLogger(AvailableDelegationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableDelegationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableDelegationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableDelegationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AvailableDelegationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableDelegations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableDelegationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available delegations 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..1d6ee7433eb26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import com.azure.resourcemanager.network.generated.models.AvailableDelegations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableDelegationsImpl implements AvailableDelegations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationsImpl.class); + + private final AvailableDelegationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableDelegationsImpl( + AvailableDelegationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java new file mode 100644 index 0000000000000..3c13ef548bc31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.EndpointServicesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableEndpointServicesClient. */ +public final class AvailableEndpointServicesClientImpl implements AvailableEndpointServicesClient { + private final ClientLogger logger = new ClientLogger(AvailableEndpointServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableEndpointServicesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableEndpointServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableEndpointServicesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailableEndpointServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableEndpointServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableEndpointServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/virtualNetworkAvailableEndpointServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..f35dcab9e3061 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableEndpointServices; +import com.azure.resourcemanager.network.generated.models.EndpointServiceResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableEndpointServicesImpl implements AvailableEndpointServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableEndpointServicesImpl.class); + + private final AvailableEndpointServicesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableEndpointServicesImpl( + AvailableEndpointServicesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + private AvailableEndpointServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java new file mode 100644 index 0000000000000..7da37af37bcf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointType; + +public final class AvailablePrivateEndpointTypeImpl implements AvailablePrivateEndpointType { + private AvailablePrivateEndpointTypeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailablePrivateEndpointTypeImpl( + AvailablePrivateEndpointTypeInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public AvailablePrivateEndpointTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java new file mode 100644 index 0000000000000..dd7a6e804bfe8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailablePrivateEndpointTypesClient. */ +public final class AvailablePrivateEndpointTypesClientImpl implements AvailablePrivateEndpointTypesClient { + private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailablePrivateEndpointTypesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailablePrivateEndpointTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailablePrivateEndpointTypesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailablePrivateEndpointTypesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailablePrivateEndpointTypes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailablePrivateEndpointTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/availablePrivateEndpointTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/availablePrivateEndpointTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(location, resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(location, resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String location, String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(location, resourceGroupName)); + } + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(location, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..ae9c725ffa838 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointType; +import com.azure.resourcemanager.network.generated.models.AvailablePrivateEndpointTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailablePrivateEndpointTypesImpl implements AvailablePrivateEndpointTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesImpl.class); + + private final AvailablePrivateEndpointTypesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailablePrivateEndpointTypesImpl( + AvailablePrivateEndpointTypesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + private AvailablePrivateEndpointTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java new file mode 100644 index 0000000000000..bb3134655e7e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import java.util.Collections; +import java.util.List; + +public final class AvailableProvidersListImpl implements AvailableProvidersList { + private AvailableProvidersListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableProvidersListImpl( + AvailableProvidersListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List countries() { + List inner = this.innerModel().countries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailableProvidersListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.java new file mode 100644 index 0000000000000..36409df8724ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegationsResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvailableResourceGroupDelegationsClient. + */ +public final class AvailableResourceGroupDelegationsClientImpl implements AvailableResourceGroupDelegationsClient { + private final ClientLogger logger = new ClientLogger(AvailableResourceGroupDelegationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableResourceGroupDelegationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableResourceGroupDelegationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableResourceGroupDelegationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailableResourceGroupDelegationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableResourceGroupDelegations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableResourceGroupDelegationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/availableDelegations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + location, + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String resourceGroupName) { + return new PagedIterable<>(listAsync(location, resourceGroupName)); + } + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(location, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available delegations 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..98e550ceb0de9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.azure.resourcemanager.network.generated.models.AvailableDelegation; +import com.azure.resourcemanager.network.generated.models.AvailableResourceGroupDelegations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableResourceGroupDelegationsImpl implements AvailableResourceGroupDelegations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableResourceGroupDelegationsImpl.class); + + private final AvailableResourceGroupDelegationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableResourceGroupDelegationsImpl( + AvailableResourceGroupDelegationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().list(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + private AvailableResourceGroupDelegationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java new file mode 100644 index 0000000000000..914b36b5a4eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAlias; + +public final class AvailableServiceAliasImpl implements AvailableServiceAlias { + private AvailableServiceAliasInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AvailableServiceAliasImpl( + AvailableServiceAliasInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public AvailableServiceAliasInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java new file mode 100644 index 0000000000000..ea073b76717c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliasesResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableServiceAliasesClient. */ +public final class AvailableServiceAliasesClientImpl implements AvailableServiceAliasesClient { + private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AvailableServiceAliasesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AvailableServiceAliasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableServiceAliasesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AvailableServiceAliasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAvailableServiceAliases to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AvailableServiceAliasesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/availableServiceAliases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("location") String location, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + location, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String location) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, location), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String location, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, location, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, location)); + } + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available service aliases 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..a60006d104ced --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAlias; +import com.azure.resourcemanager.network.generated.models.AvailableServiceAliases; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AvailableServiceAliasesImpl implements AvailableServiceAliases { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesImpl.class); + + private final AvailableServiceAliasesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AvailableServiceAliasesImpl( + AvailableServiceAliasesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, location, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + private AvailableServiceAliasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.java new file mode 100644 index 0000000000000..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..2260fe19c3ab8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTagListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AzureFirewallFqdnTagsClient. */ +public final class AzureFirewallFqdnTagsClientImpl implements AzureFirewallFqdnTagsClient { + private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AzureFirewallFqdnTagsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallFqdnTagsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureFirewallFqdnTagsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(AzureFirewallFqdnTagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAzureFirewallFqdnTags to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AzureFirewallFqdnTagsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewallFqdnTags API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..a2de75c127777 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTag; +import com.azure.resourcemanager.network.generated.models.AzureFirewallFqdnTags; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AzureFirewallFqdnTagsImpl implements AzureFirewallFqdnTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagsImpl.class); + + private final AzureFirewallFqdnTagsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AzureFirewallFqdnTagsImpl( + AzureFirewallFqdnTagsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + private AzureFirewallFqdnTagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java new file mode 100644 index 0000000000000..153f783af1379 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpGroups; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AzureFirewallImpl implements AzureFirewall, AzureFirewall.Definition, AzureFirewall.Update { + private AzureFirewallInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 AzureFirewallInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String azureFirewallName; + + private TagsObject updateParameters; + + public AzureFirewallImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AzureFirewall create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .createOrUpdate(resourceGroupName, azureFirewallName, this.innerModel(), Context.NONE); + return this; + } + + public AzureFirewall create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .createOrUpdate(resourceGroupName, azureFirewallName, this.innerModel(), context); + return this; + } + + AzureFirewallImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new AzureFirewallInner(); + this.serviceManager = serviceManager; + this.azureFirewallName = name; + } + + public AzureFirewallImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public AzureFirewall apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .updateTags(resourceGroupName, azureFirewallName, updateParameters, Context.NONE); + return this; + } + + public AzureFirewall apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .updateTags(resourceGroupName, azureFirewallName, updateParameters, context); + return this; + } + + AzureFirewallImpl( + AzureFirewallInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureFirewallName = Utils.getValueFromIdByName(innerObject.id(), "azureFirewalls"); + } + + public AzureFirewall refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE) + .getValue(); + return this; + } + + public AzureFirewall refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context) + .getValue(); + return this; + } + + public AzureFirewallImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AzureFirewallImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AzureFirewallImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AzureFirewallImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public AzureFirewallImpl withApplicationRuleCollections( + List applicationRuleCollections) { + this.innerModel().withApplicationRuleCollections(applicationRuleCollections); + return this; + } + + public AzureFirewallImpl withNatRuleCollections(List natRuleCollections) { + this.innerModel().withNatRuleCollections(natRuleCollections); + return this; + } + + public AzureFirewallImpl withNetworkRuleCollections( + List networkRuleCollections) { + this.innerModel().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + public AzureFirewallImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public AzureFirewallImpl withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration) { + this.innerModel().withManagementIpConfiguration(managementIpConfiguration); + return this; + } + + public AzureFirewallImpl withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.innerModel().withThreatIntelMode(threatIntelMode); + return this; + } + + public AzureFirewallImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public AzureFirewallImpl withFirewallPolicy(SubResource firewallPolicy) { + this.innerModel().withFirewallPolicy(firewallPolicy); + return this; + } + + public AzureFirewallImpl withHubIpAddresses(HubIpAddresses hubIpAddresses) { + this.innerModel().withHubIpAddresses(hubIpAddresses); + return this; + } + + public AzureFirewallImpl withSku(AzureFirewallSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public AzureFirewallImpl withAdditionalProperties(Map additionalProperties) { + this.innerModel().withAdditionalProperties(additionalProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java new file mode 100644 index 0000000000000..556ca8adef287 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java @@ -0,0 +1,1553 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AzureFirewallsClient. */ +public final class AzureFirewallsClientImpl implements AzureFirewallsClient { + private final ClientLogger logger = new ClientLogger(AzureFirewallsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AzureFirewallsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AzureFirewallsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureFirewallsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(AzureFirewallsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAzureFirewalls to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface AzureFirewallsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AzureFirewallInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls/{azureFirewallName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/azureFirewalls") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName) { + return beginDeleteAsync(resourceGroupName, azureFirewallName).getSyncPoller(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String azureFirewallName, Context context) { + return beginDeleteAsync(resourceGroupName, azureFirewallName, context).getSyncPoller(); + } + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupAsync(resourceGroupName, azureFirewallName).block(); + } + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName, context).block(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate( + String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to the create or update Azure Firewall operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + azureFirewallName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginUpdateTags( + String resourceGroupName, String azureFirewallName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); + } + + /** + * Updates tags of an Azure Firewall resource. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to update azure firewall tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Firewall resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..3ea6270ad7abf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewalls; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AzureFirewallsImpl implements AzureFirewalls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallsImpl.class); + + private final AzureFirewallsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AzureFirewallsImpl( + AzureFirewallsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String azureFirewallName) { + this.serviceClient().delete(resourceGroupName, azureFirewallName); + } + + public void delete(String resourceGroupName, String azureFirewallName, Context context) { + this.serviceClient().delete(resourceGroupName, azureFirewallName, context); + } + + public AzureFirewall getByResourceGroup(String resourceGroupName, String azureFirewallName) { + AzureFirewallInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, azureFirewallName); + if (inner != null) { + return new AzureFirewallImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureFirewallImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public AzureFirewall getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = Utils.getValueFromIdByName(id, "azureFirewalls"); + if (azureFirewallName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'azureFirewalls'.", id))); + } + this.delete(resourceGroupName, azureFirewallName, context); + } + + private AzureFirewallsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public AzureFirewallImpl define(String name) { + return new AzureFirewallImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java new file mode 100644 index 0000000000000..9253fb87414fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import java.util.Collections; +import java.util.List; + +public final class AzureReachabilityReportImpl implements AzureReachabilityReport { + private AzureReachabilityReportInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureReachabilityReportImpl( + AzureReachabilityReportInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aggregationLevel() { + return this.innerModel().aggregationLevel(); + } + + public AzureReachabilityReportLocation providerLocation() { + return this.innerModel().providerLocation(); + } + + public List reachabilityReport() { + List inner = this.innerModel().reachabilityReport(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureReachabilityReportInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java new file mode 100644 index 0000000000000..46048ae25edd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureWebCategoryImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategory; + +public final class AzureWebCategoryImpl implements AzureWebCategory { + private AzureWebCategoryInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + AzureWebCategoryImpl( + AzureWebCategoryInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String group() { + return this.innerModel().group(); + } + + public AzureWebCategoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..0c0b43f0b357f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BackendAddressPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String loadBalancerName; + + private String backendAddressPoolName; + + public BackendAddressPoolImpl withExistingLoadBalancer(String resourceGroupName, String loadBalancerName) { + this.resourceGroupName = resourceGroupName; + this.loadBalancerName = loadBalancerName; + return this; + } + + public BackendAddressPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), Context.NONE); + return this; + } + + public BackendAddressPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), context); + return this; + } + + BackendAddressPoolImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new BackendAddressPoolInner(); + this.serviceManager = serviceManager; + this.backendAddressPoolName = name; + } + + public BackendAddressPoolImpl update() { + return this; + } + + public BackendAddressPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), Context.NONE); + return this; + } + + public BackendAddressPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .createOrUpdate( + resourceGroupName, loadBalancerName, backendAddressPoolName, this.innerModel(), context); + return this; + } + + BackendAddressPoolImpl( + BackendAddressPoolInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = Utils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.backendAddressPoolName = Utils.getValueFromIdByName(innerObject.id(), "backendAddressPools"); + } + + public BackendAddressPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE) + .getValue(); + return this; + } + + public BackendAddressPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoadBalancerBackendAddressPools() + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context) + .getValue(); + return this; + } + + public BackendAddressPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BackendAddressPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BackendAddressPoolImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public BackendAddressPoolImpl withTunnelInterfaces(List tunnelInterfaces) { + this.innerModel().withTunnelInterfaces(tunnelInterfaces); + return this; + } + + public BackendAddressPoolImpl withLoadBalancerBackendAddresses( + List loadBalancerBackendAddresses) { + this.innerModel().withLoadBalancerBackendAddresses(loadBalancerBackendAddresses); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java new file mode 100644 index 0000000000000..3f2c6a2e09817 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSession; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; + +public final class BastionActiveSessionImpl implements BastionActiveSession { + private BastionActiveSessionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionActiveSessionImpl( + BastionActiveSessionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public Object startTime() { + return this.innerModel().startTime(); + } + + public String targetSubscriptionId() { + return this.innerModel().targetSubscriptionId(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String targetHostname() { + return this.innerModel().targetHostname(); + } + + public String targetResourceGroup() { + return this.innerModel().targetResourceGroup(); + } + + public String username() { + return this.innerModel().username(); + } + + public String targetIpAddress() { + return this.innerModel().targetIpAddress(); + } + + public BastionConnectProtocol protocol() { + return this.innerModel().protocol(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public Float sessionDurationInMins() { + return this.innerModel().sessionDurationInMins(); + } + + public BastionActiveSessionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java new file mode 100644 index 0000000000000..b95f416e95738 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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..56be0313f51b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.java @@ -0,0 +1,1555 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(BastionHostsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BastionHostsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of BastionHostsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BastionHostsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(BastionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientBastionHosts to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface BastionHostsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionHostInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String bastionHostname) { + return beginDeleteAsync(resourceGroupName, bastionHostname).getSyncPoller(); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String bastionHostname, Context context) { + return beginDeleteAsync(resourceGroupName, bastionHostname, context).getSyncPoller(); + } + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner getByResourceGroup(String resourceGroupName, String bastionHostname) { + return getByResourceGroupAsync(resourceGroupName, bastionHostname).block(); + } + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bastionHostname, context).block(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate( + String resourceGroupName, String bastionHostname, BastionHostInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, bastionHostname, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to the create or update Bastion Host operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return bastion Host resource 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 = "2021-08-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 = "2021-08-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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginUpdateTags( + String resourceGroupName, String bastionHostname, TagsObject parameters) { + return 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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginUpdateTags( + String resourceGroupName, String bastionHostname, TagsObject parameters, Context context) { + return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Bastion Hosts in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Bastion Hosts in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Bastion Hosts in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all Bastion Hosts in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..12262140fd535 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHost; +import com.azure.resourcemanager.network.generated.models.BastionHosts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BastionHostsImpl implements BastionHosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostsImpl.class); + + private final BastionHostsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public BastionHostsImpl( + BastionHostsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String bastionHostname) { + this.serviceClient().delete(resourceGroupName, bastionHostname); + } + + public void delete(String resourceGroupName, String bastionHostname, Context context) { + this.serviceClient().delete(resourceGroupName, bastionHostname, context); + } + + public BastionHost getByResourceGroup(String resourceGroupName, String bastionHostname) { + BastionHostInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, bastionHostname); + if (inner != null) { + return new BastionHostImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BastionHostImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public BastionHost getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bastionHostname, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = Utils.getValueFromIdByName(id, "bastionHosts"); + if (bastionHostname == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bastionHosts'.", id))); + } + this.delete(resourceGroupName, bastionHostname, context); + } + + private BastionHostsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BastionHostImpl define(String name) { + return new BastionHostImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java new file mode 100644 index 0000000000000..784524a4495b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.models.BastionSessionState; + +public final class BastionSessionStateImpl implements BastionSessionState { + private BastionSessionStateInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionSessionStateImpl( + BastionSessionStateInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sessionId() { + return this.innerModel().sessionId(); + } + + public String message() { + return this.innerModel().message(); + } + + public String state() { + return this.innerModel().state(); + } + + public BastionSessionStateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java new file mode 100644 index 0000000000000..c0e64bac5cc18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLink; +import com.azure.resourcemanager.network.generated.models.VM; + +public final class BastionShareableLinkImpl implements BastionShareableLink { + private BastionShareableLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BastionShareableLinkImpl( + BastionShareableLinkInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VM vm() { + return this.innerModel().vm(); + } + + public String bsl() { + return this.innerModel().bsl(); + } + + public String createdAt() { + return this.innerModel().createdAt(); + } + + public String message() { + return this.innerModel().message(); + } + + public BastionShareableLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.java new file mode 100644 index 0000000000000..33b9c053e0c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.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.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 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..a00451f060631 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunityListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BgpServiceCommunitiesClient. */ +public final class BgpServiceCommunitiesClientImpl implements BgpServiceCommunitiesClient { + private final ClientLogger logger = new ClientLogger(BgpServiceCommunitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BgpServiceCommunitiesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of BgpServiceCommunitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BgpServiceCommunitiesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(BgpServiceCommunitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientBgpServiceCommunities to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface BgpServiceCommunitiesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available bgp service communities. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListServiceCommunity API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..11452f55f5acb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunities; +import com.azure.resourcemanager.network.generated.models.BgpServiceCommunity; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BgpServiceCommunitiesImpl implements BgpServiceCommunities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunitiesImpl.class); + + private final BgpServiceCommunitiesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public BgpServiceCommunitiesImpl( + BgpServiceCommunitiesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + private BgpServiceCommunitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.java new file mode 100644 index 0000000000000..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/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..9e4d0632ef470 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitor; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorDestination; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorOutput; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSource; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ConnectionMonitorResultImpl + implements ConnectionMonitorResult, ConnectionMonitorResult.Definition, ConnectionMonitorResult.Update { + private ConnectionMonitorResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..692a8feec1b74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java @@ -0,0 +1,2215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitor; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectionMonitorsClient. */ +public final class ConnectionMonitorsClientImpl implements ConnectionMonitorsClient { + private final ClientLogger logger = new ClientLogger(ConnectionMonitorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConnectionMonitorsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectionMonitorsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ConnectionMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientConnectionMonitors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ConnectionMonitorsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("migrate") String migrate, + @BodyParam("application/json") ConnectionMonitor parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> query( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("connectionMonitorName") String connectionMonitorName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectionMonitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + migrate, + parameters, + accept, + context); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .getSyncPoller(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context) + .getSyncPoller(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor 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. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .block(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters) { + final String migrate = null; + return createOrUpdateAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) + .block(); + } + + /** + * Create or update a connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters that define the operation to create a connection monitor. + * @param migrate Value indicating whether connection monitor V1 should be migrated to V2 format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner createOrUpdate( + String resourceGroupName, + String networkWatcherName, + String connectionMonitorName, + ConnectionMonitor parameters, + String migrate, + Context context) { + return createOrUpdateAsync( + resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate, context) + .block(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner get( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return getAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); + } + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorResultInner updateTags( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).block(); + } + + /** + * Update tags of the specified connection monitor. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param connectionMonitorName The name of the connection monitor. + * @param parameters Parameters supplied to update connection monitor tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the connection monitor 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginStartAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .query( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + connectionMonitorName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName).getSyncPoller(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorQueryResultInner> beginQuery( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return beginQueryAsync(resourceGroupName, networkWatcherName, connectionMonitorName, context).getSyncPoller(); + } + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java new file mode 100644 index 0000000000000..e9e80aad78dc1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorQueryResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorQueryResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConnectionMonitorsImpl implements ConnectionMonitors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorsImpl.class); + + private final ConnectionMonitorsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ConnectionMonitorsImpl( + ConnectionMonitorsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ConnectionMonitorResult get( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorResultInner inner = + this.serviceClient().get(resourceGroupName, networkWatcherName, connectionMonitorName); + if (inner != null) { + return new ConnectionMonitorResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectionMonitorResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void delete( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void stop( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + this.serviceClient().start(resourceGroupName, networkWatcherName, connectionMonitorName); + } + + public void start( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + this.serviceClient().start(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + ConnectionMonitorQueryResultInner inner = + this.serviceClient().query(resourceGroupName, networkWatcherName, connectionMonitorName); + if (inner != null) { + return new ConnectionMonitorQueryResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + ConnectionMonitorQueryResultInner inner = + this.serviceClient().query(resourceGroupName, networkWatcherName, connectionMonitorName, context); + if (inner != null) { + return new ConnectionMonitorQueryResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public ConnectionMonitorResult getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String connectionMonitorName = Utils.getValueFromIdByName(id, "connectionMonitors"); + if (connectionMonitorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitors'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, connectionMonitorName, context); + } + + private ConnectionMonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ConnectionMonitorResultImpl define(String name) { + return new ConnectionMonitorResultImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java new file mode 100644 index 0000000000000..0667470d1eb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionResetSharedKey; + +public final class ConnectionResetSharedKeyImpl implements ConnectionResetSharedKey { + private ConnectionResetSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionResetSharedKeyImpl( + ConnectionResetSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int keyLength() { + return this.innerModel().keyLength(); + } + + public ConnectionResetSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java new file mode 100644 index 0000000000000..68dc4b2ad5aa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKey; + +public final class ConnectionSharedKeyImpl implements ConnectionSharedKey { + private ConnectionSharedKeyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionSharedKeyImpl( + ConnectionSharedKeyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String value() { + return this.innerModel().value(); + } + + public ConnectionSharedKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java new file mode 100644 index 0000000000000..bf46680145f4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import java.util.Collections; +import java.util.List; + +public final class ConnectivityInformationImpl implements ConnectivityInformation { + private ConnectivityInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectivityInformationImpl( + ConnectivityInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List hops() { + List inner = this.innerModel().hops(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public Integer avgLatencyInMs() { + return this.innerModel().avgLatencyInMs(); + } + + public Integer minLatencyInMs() { + return this.innerModel().minLatencyInMs(); + } + + public Integer maxLatencyInMs() { + return this.innerModel().maxLatencyInMs(); + } + + public Integer probesSent() { + return this.innerModel().probesSent(); + } + + public Integer probesFailed() { + return this.innerModel().probesFailed(); + } + + public ConnectivityInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java new file mode 100644 index 0000000000000..148d497300950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.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.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +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 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 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 CustomIpPrefixInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String customIpPrefixName; + + private TagsObject updateParameters; + + public CustomIpPrefixImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CustomIpPrefix create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .createOrUpdate(resourceGroupName, customIpPrefixName, this.innerModel(), Context.NONE); + return this; + } + + public CustomIpPrefix create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .createOrUpdate(resourceGroupName, customIpPrefixName, this.innerModel(), context); + return this; + } + + CustomIpPrefixImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new CustomIpPrefixInner(); + this.serviceManager = serviceManager; + this.customIpPrefixName = name; + } + + public CustomIpPrefixImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public CustomIpPrefix apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .updateTagsWithResponse(resourceGroupName, customIpPrefixName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public CustomIpPrefix apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .updateTagsWithResponse(resourceGroupName, customIpPrefixName, updateParameters, context) + .getValue(); + return this; + } + + CustomIpPrefixImpl( + CustomIpPrefixInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.customIpPrefixName = Utils.getValueFromIdByName(innerObject.id(), "customIpPrefixes"); + } + + public CustomIpPrefix refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public CustomIpPrefix refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getCustomIpPrefixes() + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, context) + .getValue(); + return this; + } + + public CustomIpPrefixImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CustomIpPrefixImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CustomIpPrefixImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public CustomIpPrefixImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public CustomIpPrefixImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public CustomIpPrefixImpl withCidr(String cidr) { + this.innerModel().withCidr(cidr); + return this; + } + + public CustomIpPrefixImpl withSignedMessage(String signedMessage) { + this.innerModel().withSignedMessage(signedMessage); + return this; + } + + public CustomIpPrefixImpl withAuthorizationMessage(String authorizationMessage) { + this.innerModel().withAuthorizationMessage(authorizationMessage); + return this; + } + + public CustomIpPrefixImpl withCustomIpPrefixParent(SubResource customIpPrefixParent) { + this.innerModel().withCustomIpPrefixParent(customIpPrefixParent); + return this; + } + + public CustomIpPrefixImpl withCommissionedState(CommissionedState commissionedState) { + this.innerModel().withCommissionedState(commissionedState); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java new file mode 100644 index 0000000000000..34a26f162444e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomIpPrefixesClient. */ +public final class CustomIpPrefixesClientImpl implements CustomIpPrefixesClient { + private final ClientLogger logger = new ClientLogger(CustomIpPrefixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CustomIpPrefixesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of CustomIpPrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomIpPrefixesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(CustomIpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientCustomIpPrefixes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface CustomIpPrefixesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CustomIpPrefixInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes/{customIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("customIpPrefixName") String customIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/customIpPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String customIpPrefixName) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName).getSyncPoller(); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String customIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, customIpPrefixName, context).getSyncPoller(); + } + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String customIpPrefixName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner getByResourceGroup(String resourceGroupName, String customIpPrefixName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, customIpPrefixName, expand).block(); + } + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + customIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, customIpPrefixName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to the create or update custom IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomIpPrefixInner updateTags(String resourceGroupName, String customIpPrefixName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, customIpPrefixName, parameters).block(); + } + + /** + * Updates custom IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param parameters Parameters supplied to update custom IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom IP prefix resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..41834836d2485 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomIpPrefixesImpl implements CustomIpPrefixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixesImpl.class); + + private final CustomIpPrefixesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public CustomIpPrefixesImpl( + CustomIpPrefixesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String customIpPrefixName) { + this.serviceClient().delete(resourceGroupName, customIpPrefixName); + } + + public void delete(String resourceGroupName, String customIpPrefixName, Context context) { + this.serviceClient().delete(resourceGroupName, customIpPrefixName, context); + } + + public CustomIpPrefix getByResourceGroup(String resourceGroupName, String customIpPrefixName) { + CustomIpPrefixInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, customIpPrefixName); + if (inner != null) { + return new CustomIpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomIpPrefixImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public CustomIpPrefix getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = Utils.getValueFromIdByName(id, "customIpPrefixes"); + if (customIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customIpPrefixes'.", id))); + } + this.delete(resourceGroupName, customIpPrefixName, context); + } + + private CustomIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public CustomIpPrefixImpl define(String name) { + return new CustomIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java new file mode 100644 index 0000000000000..04429fcae5673 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java @@ -0,0 +1,970 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DdosCustomPoliciesClient. */ +public final class DdosCustomPoliciesClientImpl implements DdosCustomPoliciesClient { + private final ClientLogger logger = new ClientLogger(DdosCustomPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DdosCustomPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosCustomPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DdosCustomPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DdosCustomPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDdosCustomPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DdosCustomPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DdosCustomPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosCustomPolicies/{ddosCustomPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosCustomPolicyName") String ddosCustomPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosCustomPolicyName) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosCustomPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupAsync(resourceGroupName, ddosCustomPolicyName).block(); + } + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName, context).block(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosCustomPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosCustomPolicyInner updateTags( + String resourceGroupName, String ddosCustomPolicyName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters).block(); + } + + /** + * Update a DDoS custom policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param parameters Parameters supplied to update DDoS custom policy resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS custom policy in a resource group 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(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java new file mode 100644 index 0000000000000..03a9b6a8e3d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicies; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DdosCustomPoliciesImpl implements DdosCustomPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosCustomPoliciesImpl.class); + + private final DdosCustomPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DdosCustomPoliciesImpl( + DdosCustomPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + this.serviceClient().delete(resourceGroupName, ddosCustomPolicyName); + } + + public void delete(String resourceGroupName, String ddosCustomPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, ddosCustomPolicyName, context); + } + + public DdosCustomPolicy getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + DdosCustomPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ddosCustomPolicyName); + if (inner != null) { + return new DdosCustomPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DdosCustomPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DdosCustomPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = Utils.getValueFromIdByName(id, "ddosCustomPolicies"); + if (ddosCustomPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosCustomPolicies'.", id))); + } + this.delete(resourceGroupName, ddosCustomPolicyName, context); + } + + private DdosCustomPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosCustomPolicyImpl define(String name) { + return new DdosCustomPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java new file mode 100644 index 0000000000000..6c17c850203e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DdosCustomPolicyImpl + implements DdosCustomPolicy, DdosCustomPolicy.Definition, DdosCustomPolicy.Update { + private DdosCustomPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String id() { + return this.innerModel().id(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List protocolCustomSettings() { + List inner = this.innerModel().protocolCustomSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DdosCustomPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ddosCustomPolicyName; + + private TagsObject updateParameters; + + public DdosCustomPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DdosCustomPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .createOrUpdate(resourceGroupName, ddosCustomPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public DdosCustomPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .createOrUpdate(resourceGroupName, ddosCustomPolicyName, this.innerModel(), context); + return this; + } + + DdosCustomPolicyImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new DdosCustomPolicyInner(); + this.serviceManager = serviceManager; + this.ddosCustomPolicyName = name; + } + + public DdosCustomPolicyImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public DdosCustomPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .updateTagsWithResponse(resourceGroupName, ddosCustomPolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DdosCustomPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .updateTagsWithResponse(resourceGroupName, ddosCustomPolicyName, updateParameters, context) + .getValue(); + return this; + } + + DdosCustomPolicyImpl( + DdosCustomPolicyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosCustomPolicyName = Utils.getValueFromIdByName(innerObject.id(), "ddosCustomPolicies"); + } + + public DdosCustomPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE) + .getValue(); + return this; + } + + public DdosCustomPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosCustomPolicies() + .getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, context) + .getValue(); + return this; + } + + public DdosCustomPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosCustomPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosCustomPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DdosCustomPolicyImpl withProtocolCustomSettings(List protocolCustomSettings) { + this.innerModel().withProtocolCustomSettings(protocolCustomSettings); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java new file mode 100644 index 0000000000000..9778e6a033ff6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DdosProtectionPlanImpl + implements DdosProtectionPlan, DdosProtectionPlan.Definition, DdosProtectionPlan.Update { + private DdosProtectionPlanInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualNetworks() { + List inner = this.innerModel().virtualNetworks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DdosProtectionPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String ddosProtectionPlanName; + + private TagsObject updateParameters; + + public DdosProtectionPlanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DdosProtectionPlan create() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.innerModel(), Context.NONE); + return this; + } + + public DdosProtectionPlan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .createOrUpdate(resourceGroupName, ddosProtectionPlanName, this.innerModel(), context); + return this; + } + + DdosProtectionPlanImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new DdosProtectionPlanInner(); + this.serviceManager = serviceManager; + this.ddosProtectionPlanName = name; + } + + public DdosProtectionPlanImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public DdosProtectionPlan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .updateTagsWithResponse(resourceGroupName, ddosProtectionPlanName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DdosProtectionPlan apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .updateTagsWithResponse(resourceGroupName, ddosProtectionPlanName, updateParameters, context) + .getValue(); + return this; + } + + DdosProtectionPlanImpl( + DdosProtectionPlanInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosProtectionPlanName = Utils.getValueFromIdByName(innerObject.id(), "ddosProtectionPlans"); + } + + public DdosProtectionPlan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE) + .getValue(); + return this; + } + + public DdosProtectionPlan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDdosProtectionPlans() + .getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context) + .getValue(); + return this; + } + + public DdosProtectionPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DdosProtectionPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DdosProtectionPlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java new file mode 100644 index 0000000000000..67f5fe8e3fe76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java @@ -0,0 +1,1483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlanListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DdosProtectionPlansClient. */ +public final class DdosProtectionPlansClientImpl implements DdosProtectionPlansClient { + private final ClientLogger logger = new ClientLogger(DdosProtectionPlansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DdosProtectionPlansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DdosProtectionPlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DdosProtectionPlansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DdosProtectionPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDdosProtectionPlans to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DdosProtectionPlansService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DdosProtectionPlanInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans/{ddosProtectionPlanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ddosProtectionPlanName") String ddosProtectionPlanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ddosProtectionPlans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName).getSyncPoller(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + return beginDeleteAsync(resourceGroupName, ddosProtectionPlanName, context).getSyncPoller(); + } + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupAsync(resourceGroupName, ddosProtectionPlanName).block(); + } + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName, context).block(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ddosProtectionPlanName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DdosProtectionPlanInner updateTags( + String resourceGroupName, String ddosProtectionPlanName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); + } + + /** + * Update a DDoS protection plan tags. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param parameters Parameters supplied to the update DDoS protection plan resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DDoS protection plan in a resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DDoS protection plans 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..ab776bd522aec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlans; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DdosProtectionPlansImpl implements DdosProtectionPlans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlansImpl.class); + + private final DdosProtectionPlansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DdosProtectionPlansImpl( + DdosProtectionPlansClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + this.serviceClient().delete(resourceGroupName, ddosProtectionPlanName); + } + + public void delete(String resourceGroupName, String ddosProtectionPlanName, Context context) { + this.serviceClient().delete(resourceGroupName, ddosProtectionPlanName, context); + } + + public DdosProtectionPlan getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + DdosProtectionPlanInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, ddosProtectionPlanName); + if (inner != null) { + return new DdosProtectionPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DdosProtectionPlanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public DdosProtectionPlan getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = Utils.getValueFromIdByName(id, "ddosProtectionPlans"); + if (ddosProtectionPlanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ddosProtectionPlans'.", id))); + } + this.delete(resourceGroupName, ddosProtectionPlanName, context); + } + + private DdosProtectionPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DdosProtectionPlanImpl define(String name) { + return new DdosProtectionPlanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java new file mode 100644 index 0000000000000..13c85d3f5366e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DefaultSecurityRulesClient. */ +public final class DefaultSecurityRulesClientImpl implements DefaultSecurityRulesClient { + private final ClientLogger logger = new ClientLogger(DefaultSecurityRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DefaultSecurityRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DefaultSecurityRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefaultSecurityRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(DefaultSecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDefaultSecurityRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DefaultSecurityRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("defaultSecurityRuleName") String defaultSecurityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); + } + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, context)); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner get( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + return getAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).block(); + } + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule 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 next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityRule API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..42f0016a3f3ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.DefaultSecurityRules; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DefaultSecurityRulesImpl implements DefaultSecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultSecurityRulesImpl.class); + + private final DefaultSecurityRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DefaultSecurityRulesImpl( + DefaultSecurityRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkSecurityGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName) { + SecurityRuleInner inner = + this.serviceClient().get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName); + if (inner != null) { + return new SecurityRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DefaultSecurityRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..97671920fcebb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; + +public final class DnsNameAvailabilityResultImpl implements DnsNameAvailabilityResult { + private DnsNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + DnsNameAvailabilityResultImpl( + DnsNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public DnsNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java new file mode 100644 index 0000000000000..7056d3db257ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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..a4a921b89a8c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.DscpConfigurationListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DscpConfigurationsClient. */ +public final class DscpConfigurationsClientImpl implements DscpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(DscpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DscpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of DscpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DscpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(DscpConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientDscpConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface DscpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DscpConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations/{dscpConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dscpConfigurationName") String dscpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/dscpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return differentiated Services Code Point configuration for any given network interface along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, dscpConfigurationName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param parameters Parameters supplied to the create or update dscp configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dscpConfigurationName) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName).getSyncPoller(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dscpConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, dscpConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DscpConfigurationInner getByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + return getByResourceGroupAsync(resourceGroupName, dscpConfigurationName).block(); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all dscp configurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the DscpConfigurationList API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..97c7380bef505 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.DscpConfiguration; +import com.azure.resourcemanager.network.generated.models.DscpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DscpConfigurationsImpl implements DscpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationsImpl.class); + + private final DscpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public DscpConfigurationsImpl( + DscpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + this.serviceClient().delete(resourceGroupName, dscpConfigurationName); + } + + public void delete(String resourceGroupName, String dscpConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, dscpConfigurationName, context); + } + + public DscpConfiguration getByResourceGroup(String resourceGroupName, String dscpConfigurationName) { + DscpConfigurationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, dscpConfigurationName); + if (inner != null) { + return new DscpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DscpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public DscpConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = Utils.getValueFromIdByName(id, "dscpConfigurations"); + if (dscpConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dscpConfigurations'.", id))); + } + this.delete(resourceGroupName, dscpConfigurationName, context); + } + + private DscpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public DscpConfigurationImpl define(String name) { + return new DscpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java new file mode 100644 index 0000000000000..a7679f4199e4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveNetworkSecurityGroupListResultImpl implements EffectiveNetworkSecurityGroupListResult { + private EffectiveNetworkSecurityGroupListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveNetworkSecurityGroupListResultImpl( + EffectiveNetworkSecurityGroupListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveNetworkSecurityGroupListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java new file mode 100644 index 0000000000000..b632d72835726 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import java.util.Collections; +import java.util.List; + +public final class EffectiveRouteListResultImpl implements EffectiveRouteListResult { + private EffectiveRouteListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveRouteListResultImpl( + EffectiveRouteListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EffectiveRouteListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java new file mode 100644 index 0000000000000..3fc639dfa9eda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.azure.resourcemanager.network.generated.models.EndpointServiceResult; + +public final class EndpointServiceResultImpl implements EndpointServiceResult { + private EndpointServiceResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EndpointServiceResultImpl( + EndpointServiceResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EndpointServiceResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java new file mode 100644 index 0000000000000..0734facdae69d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCircuitAuthorizationImpl + implements ExpressRouteCircuitAuthorization, + ExpressRouteCircuitAuthorization.Definition, + ExpressRouteCircuitAuthorization.Update { + private ExpressRouteCircuitAuthorizationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public AuthorizationUseStatus authorizationUseStatus() { + return this.innerModel().authorizationUseStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitAuthorizationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String authorizationName; + + public ExpressRouteCircuitAuthorizationImpl withExistingExpressRouteCircuit( + String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + public ExpressRouteCircuitAuthorization create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitAuthorization create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitAuthorizationImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitAuthorizationInner(); + this.serviceManager = serviceManager; + this.authorizationName = name; + } + + public ExpressRouteCircuitAuthorizationImpl update() { + return this; + } + + public ExpressRouteCircuitAuthorization apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitAuthorization apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .createOrUpdate(resourceGroupName, circuitName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitAuthorizationImpl( + ExpressRouteCircuitAuthorizationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.authorizationName = Utils.getValueFromIdByName(innerObject.id(), "authorizations"); + } + + public ExpressRouteCircuitAuthorization refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorization refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitAuthorizations() + .getWithResponse(resourceGroupName, circuitName, authorizationName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitAuthorizationImpl withAuthorizationUseStatus( + AuthorizationUseStatus authorizationUseStatus) { + this.innerModel().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java new file mode 100644 index 0000000000000..1050d302659ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java @@ -0,0 +1,1193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.AuthorizationListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCircuitAuthorizationsClient. + */ +public final class ExpressRouteCircuitAuthorizationsClientImpl implements ExpressRouteCircuitAuthorizationsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitAuthorizationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitAuthorizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitAuthorizationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitAuthorizationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitAuthorizations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitAuthorizationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitAuthorizationInner authorizationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/authorizations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName).getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, authorizationName, context).getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitAuthorizationInner get( + String resourceGroupName, String circuitName, String authorizationName) { + return getAsync(resourceGroupName, circuitName, authorizationName).block(); + } + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + authorizationName, + apiVersion, + this.client.getSubscriptionId(), + authorizationParameters, + accept, + context); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route circuit authorization + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authorization in an ExpressRouteCircuit resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String circuitName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String circuitName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); + } + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAuthorizations API service call retrieves all authorizations that belongs to an + * ExpressRouteCircuit 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..cf8ac14bae43e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorization; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitAuthorizations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitAuthorizationsImpl implements ExpressRouteCircuitAuthorizations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitAuthorizationsImpl.class); + + private final ExpressRouteCircuitAuthorizationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitAuthorizationsImpl( + ExpressRouteCircuitAuthorizationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String authorizationName) { + this.serviceClient().delete(resourceGroupName, circuitName, authorizationName); + } + + public void delete(String resourceGroupName, String circuitName, String authorizationName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, authorizationName, context); + } + + public ExpressRouteCircuitAuthorization get( + String resourceGroupName, String circuitName, String authorizationName) { + ExpressRouteCircuitAuthorizationInner inner = + this.serviceClient().get(resourceGroupName, circuitName, authorizationName); + if (inner != null) { + return new ExpressRouteCircuitAuthorizationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, authorizationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitAuthorizationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitAuthorization getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, authorizationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, circuitName, authorizationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, circuitName, authorizationName, context); + } + + private ExpressRouteCircuitAuthorizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitAuthorizationImpl define(String name) { + return new ExpressRouteCircuitAuthorizationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..7609914ab6c22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteCircuitConnectionImpl + implements ExpressRouteCircuitConnection, + ExpressRouteCircuitConnection.Definition, + ExpressRouteCircuitConnection.Update { + private ExpressRouteCircuitConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public SubResource peerExpressRouteCircuitPeering() { + return this.innerModel().peerExpressRouteCircuitPeering(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig() { + return this.innerModel().ipv6CircuitConnectionConfig(); + } + + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String peeringName; + + private String connectionName; + + public ExpressRouteCircuitConnectionImpl withExistingPeering( + String resourceGroupName, String circuitName, String peeringName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + this.peeringName = peeringName; + return this; + } + + public ExpressRouteCircuitConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitConnectionImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitConnectionInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public ExpressRouteCircuitConnectionImpl update() { + return this; + } + + public ExpressRouteCircuitConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .createOrUpdate( + resourceGroupName, circuitName, peeringName, connectionName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitConnectionImpl( + ExpressRouteCircuitConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + this.connectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public ExpressRouteCircuitConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitConnections() + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitConnectionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitConnectionImpl withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering) { + this.innerModel().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withPeerExpressRouteCircuitPeering( + SubResource peerExpressRouteCircuitPeering) { + this.innerModel().withPeerExpressRouteCircuitPeering(peerExpressRouteCircuitPeering); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public ExpressRouteCircuitConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitConnectionImpl withIpv6CircuitConnectionConfig( + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig) { + this.innerModel().withIpv6CircuitConnectionConfig(ipv6CircuitConnectionConfig); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..86dd017d8515c --- /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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitConnectionsClient. */ +public final class ExpressRouteCircuitConnectionsClientImpl implements ExpressRouteCircuitConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitConnectionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).getSyncPoller(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); + } + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + expressRouteCircuitConnectionParameters, + accept, + context); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + circuitName, + peeringName, + connectionName, + expressRouteCircuitConnectionParameters, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a Express Route Circuit Connection in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param expressRouteCircuitConnectionParameters Parameters supplied to the create or update express route circuit + * connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return express Route Circuit Connection in an ExpressRouteCircuitPeering resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName)); + } + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListConnections API service call retrieves all global reach connections that belongs to a + * Private Peering for an ExpressRouteCircuit 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..5d3a4302adc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitConnectionsImpl implements ExpressRouteCircuitConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionsImpl.class); + + private final ExpressRouteCircuitConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitConnectionsImpl( + ExpressRouteCircuitConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, connectionName); + } + + public void delete( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + public ExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + ExpressRouteCircuitConnectionInner inner = + this.serviceClient().get(resourceGroupName, circuitName, peeringName, connectionName); + if (inner != null) { + return new ExpressRouteCircuitConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, connectionName, context); + } + + private ExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitConnectionImpl define(String name) { + return new ExpressRouteCircuitConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java new file mode 100644 index 0000000000000..e3f295326d38a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRouteCircuitInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private TagsObject updateParameters; + + public ExpressRouteCircuitImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRouteCircuit create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .createOrUpdate(resourceGroupName, circuitName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuit create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .createOrUpdate(resourceGroupName, circuitName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitInner(); + this.serviceManager = serviceManager; + this.circuitName = name; + } + + public ExpressRouteCircuitImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ExpressRouteCircuit apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .updateTagsWithResponse(resourceGroupName, circuitName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuit apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .updateTagsWithResponse(resourceGroupName, circuitName, updateParameters, context) + .getValue(); + return this; + } + + ExpressRouteCircuitImpl( + ExpressRouteCircuitInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + } + + public ExpressRouteCircuit refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuit refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuits() + .getByResourceGroupWithResponse(resourceGroupName, circuitName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteCircuitImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteCircuitImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRouteCircuitImpl withSku(ExpressRouteCircuitSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ExpressRouteCircuitImpl withAllowClassicOperations(Boolean allowClassicOperations) { + this.innerModel().withAllowClassicOperations(allowClassicOperations); + return this; + } + + public ExpressRouteCircuitImpl withCircuitProvisioningState(String circuitProvisioningState) { + this.innerModel().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState) { + this.innerModel().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + public ExpressRouteCircuitImpl withAuthorizations(List authorizations) { + this.innerModel().withAuthorizations(authorizations); + return this; + } + + public ExpressRouteCircuitImpl withPeerings(List peerings) { + this.innerModel().withPeerings(peerings); + return this; + } + + public ExpressRouteCircuitImpl withServiceKey(String serviceKey) { + this.innerModel().withServiceKey(serviceKey); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderNotes(String serviceProviderNotes) { + this.innerModel().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + public ExpressRouteCircuitImpl withServiceProviderProperties( + ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + this.innerModel().withServiceProviderProperties(serviceProviderProperties); + return this; + } + + public ExpressRouteCircuitImpl withExpressRoutePort(SubResource expressRoutePort) { + this.innerModel().withExpressRoutePort(expressRoutePort); + return this; + } + + public ExpressRouteCircuitImpl withBandwidthInGbps(Float bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRouteCircuitImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitImpl withGlobalReachEnabled(Boolean globalReachEnabled) { + this.innerModel().withGlobalReachEnabled(globalReachEnabled); + return this; + } + + 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..dfb7b009292a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionId; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePeeringType; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteCircuitPeeringImpl + implements ExpressRouteCircuitPeering, ExpressRouteCircuitPeering.Definition, ExpressRouteCircuitPeering.Update { + private ExpressRouteCircuitPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExpressRoutePeeringType peeringType() { + return this.innerModel().peeringType(); + } + + public ExpressRoutePeeringState state() { + return this.innerModel().state(); + } + + public Integer azureAsn() { + return this.innerModel().azureAsn(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String primaryPeerAddressPrefix() { + return this.innerModel().primaryPeerAddressPrefix(); + } + + public String secondaryPeerAddressPrefix() { + return this.innerModel().secondaryPeerAddressPrefix(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Integer vlanId() { + return this.innerModel().vlanId(); + } + + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerModel().microsoftPeeringConfig(); + } + + public ExpressRouteCircuitStats stats() { + ExpressRouteCircuitStatsInner inner = this.innerModel().stats(); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String gatewayManagerEtag() { + return this.innerModel().gatewayManagerEtag(); + } + + public String lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public SubResource routeFilter() { + return this.innerModel().routeFilter(); + } + + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerModel().ipv6PeeringConfig(); + } + + public ExpressRouteConnectionId expressRouteConnection() { + return this.innerModel().expressRouteConnection(); + } + + public List connections() { + List inner = this.innerModel().connections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List peeredConnections() { + List inner = this.innerModel().peeredConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteCircuitPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String circuitName; + + private String peeringName; + + public ExpressRouteCircuitPeeringImpl withExistingExpressRouteCircuit( + String resourceGroupName, String circuitName) { + this.resourceGroupName = resourceGroupName; + this.circuitName = circuitName; + return this; + } + + public ExpressRouteCircuitPeering create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitPeering create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitPeeringImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteCircuitPeeringInner(); + this.serviceManager = serviceManager; + this.peeringName = name; + } + + public ExpressRouteCircuitPeeringImpl update() { + return this; + } + + public ExpressRouteCircuitPeering apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteCircuitPeering apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .createOrUpdate(resourceGroupName, circuitName, peeringName, this.innerModel(), context); + return this; + } + + ExpressRouteCircuitPeeringImpl( + ExpressRouteCircuitPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public ExpressRouteCircuitPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteCircuitPeerings() + .getWithResponse(resourceGroupName, circuitName, peeringName, context) + .getValue(); + return this; + } + + public ExpressRouteCircuitPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeeringType(ExpressRoutePeeringType peeringType) { + this.innerModel().withPeeringType(peeringType); + return this; + } + + public ExpressRouteCircuitPeeringImpl withState(ExpressRoutePeeringState state) { + this.innerModel().withState(state); + return this; + } + + public ExpressRouteCircuitPeeringImpl withAzureAsn(Integer azureAsn) { + this.innerModel().withAzureAsn(azureAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.innerModel().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.innerModel().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + public ExpressRouteCircuitPeeringImpl withPrimaryAzurePort(String primaryAzurePort) { + this.innerModel().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSecondaryAzurePort(String secondaryAzurePort) { + this.innerModel().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + public ExpressRouteCircuitPeeringImpl withSharedKey(String sharedKey) { + this.innerModel().withSharedKey(sharedKey); + return this; + } + + public ExpressRouteCircuitPeeringImpl withVlanId(Integer vlanId) { + this.innerModel().withVlanId(vlanId); + return this; + } + + public ExpressRouteCircuitPeeringImpl withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.innerModel().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withStats(ExpressRouteCircuitStatsInner stats) { + this.innerModel().withStats(stats); + return this; + } + + public ExpressRouteCircuitPeeringImpl withGatewayManagerEtag(String gatewayManagerEtag) { + this.innerModel().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + public ExpressRouteCircuitPeeringImpl withRouteFilter(SubResource routeFilter) { + this.innerModel().withRouteFilter(routeFilter); + return this; + } + + public ExpressRouteCircuitPeeringImpl withIpv6PeeringConfig( + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.innerModel().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + public ExpressRouteCircuitPeeringImpl withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection) { + this.innerModel().withExpressRouteConnection(expressRouteConnection); + return this; + } + + public ExpressRouteCircuitPeeringImpl withConnections(List connections) { + this.innerModel().withConnections(connections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..1a1937711db8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java @@ -0,0 +1,1160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitPeeringsClient. */ +public final class ExpressRouteCircuitPeeringsClientImpl implements ExpressRouteCircuitPeeringsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCircuitPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuitPeerings to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitPeeringInner peeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getAsync(resourceGroupName, circuitName, peeringName).block(); + } + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String circuitName, + String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified express route circuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update express route circuit peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRouteCircuit resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String circuitName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String circuitName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName)); + } + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit + * 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..6edfcefac376d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitPeeringsImpl implements ExpressRouteCircuitPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringsImpl.class); + + private final ExpressRouteCircuitPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitPeeringsImpl( + ExpressRouteCircuitPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String circuitName, String peeringName) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName); + } + + public void delete(String resourceGroupName, String circuitName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, peeringName, context); + } + + public ExpressRouteCircuitPeering get(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitPeeringInner inner = this.serviceClient().get(resourceGroupName, circuitName, peeringName); + if (inner != null) { + return new ExpressRouteCircuitPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, circuitName, peeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, circuitName, peeringName, context); + } + + private ExpressRouteCircuitPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitPeeringImpl define(String name) { + return new ExpressRouteCircuitPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java new file mode 100644 index 0000000000000..faf12e8c1596a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; + +public final class ExpressRouteCircuitStatsImpl implements ExpressRouteCircuitStats { + private ExpressRouteCircuitStatsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitStatsImpl( + ExpressRouteCircuitStatsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long primarybytesIn() { + return this.innerModel().primarybytesIn(); + } + + public Long primarybytesOut() { + return this.innerModel().primarybytesOut(); + } + + public Long secondarybytesIn() { + return this.innerModel().secondarybytesIn(); + } + + public Long secondarybytesOut() { + return this.innerModel().secondarybytesOut(); + } + + public ExpressRouteCircuitStatsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java new file mode 100644 index 0000000000000..f97a3b071ce5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsArpTableListResultImpl implements ExpressRouteCircuitsArpTableListResult { + private ExpressRouteCircuitsArpTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsArpTableListResultImpl( + ExpressRouteCircuitsArpTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsArpTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java new file mode 100644 index 0000000000000..16fce946a3c16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java @@ -0,0 +1,2778 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCircuitsClient. */ +public final class ExpressRouteCircuitsClientImpl implements ExpressRouteCircuitsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCircuitsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCircuitsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCircuitsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteCircuitsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCircuits to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCircuitsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCircuitInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listArpTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTableSummary( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/stats") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getStats( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPeeringStats( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName) { + return beginDeleteAsync(resourceGroupName, circuitName).getSyncPoller(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String circuitName, Context context) { + return beginDeleteAsync(resourceGroupName, circuitName, context).getSyncPoller(); + } + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupAsync(resourceGroupName, circuitName).block(); + } + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName, context).block(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create or update express route circuit operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, circuitName, parameters).block(); + } + + /** + * Updates an express route circuit tags. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to update express route circuit tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCircuit resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsAsync(resourceGroupName, circuitName).block(); + } + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group 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 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCircuitStatsInner getPeeringStats( + String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsAsync(resourceGroupName, circuitName, peeringName).block(); + } + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group 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 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the express route circuits in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCircuit API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..9caddc64091dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitStats; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuits; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableSummaryListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCircuitsImpl implements ExpressRouteCircuits { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitsImpl.class); + + private final ExpressRouteCircuitsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCircuitsImpl( + ExpressRouteCircuitsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String circuitName) { + this.serviceClient().delete(resourceGroupName, circuitName); + } + + public void delete(String resourceGroupName, String circuitName, Context context) { + this.serviceClient().delete(resourceGroupName, circuitName, context); + } + + public ExpressRouteCircuit getByResourceGroup(String resourceGroupName, String circuitName) { + ExpressRouteCircuitInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, circuitName); + if (inner != null) { + return new ExpressRouteCircuitImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, circuitName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableSummaryListResultInner inner = + this.serviceClient().listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitStats getStats(String resourceGroupName, String circuitName) { + ExpressRouteCircuitStatsInner inner = this.serviceClient().getStats(resourceGroupName, circuitName); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context) { + Response inner = + this.serviceClient().getStatsWithResponse(resourceGroupName, circuitName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitStatsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitStats getPeeringStats(String resourceGroupName, String circuitName, String peeringName) { + ExpressRouteCircuitStatsInner inner = + this.serviceClient().getPeeringStats(resourceGroupName, circuitName, peeringName); + if (inner != null) { + return new ExpressRouteCircuitStatsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context) { + Response inner = + this.serviceClient().getPeeringStatsWithResponse(resourceGroupName, circuitName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCircuitStatsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public ExpressRouteCircuit getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, circuitName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = Utils.getValueFromIdByName(id, "expressRouteCircuits"); + if (circuitName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteCircuits'.", + id))); + } + this.delete(resourceGroupName, circuitName, context); + } + + private ExpressRouteCircuitsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCircuitImpl define(String name) { + return new ExpressRouteCircuitImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java new file mode 100644 index 0000000000000..382f256d5259a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableListResultImpl implements ExpressRouteCircuitsRoutesTableListResult { + private ExpressRouteCircuitsRoutesTableListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableListResultImpl( + ExpressRouteCircuitsRoutesTableListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..0de4999c4953d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCircuitsRoutesTableSummaryListResultImpl + implements ExpressRouteCircuitsRoutesTableSummaryListResult { + private ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitsRoutesTableSummaryListResultImpl( + ExpressRouteCircuitsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCircuitsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java new file mode 100644 index 0000000000000..bb9cd2cf33e5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; + +public final class ExpressRouteConnectionImpl implements ExpressRouteConnection { + private ExpressRouteConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteConnectionImpl( + ExpressRouteConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public Boolean expressRouteGatewayBypass() { + return this.innerModel().expressRouteGatewayBypass(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public ExpressRouteConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java new file mode 100644 index 0000000000000..78141ec0b225e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteConnectionListImpl implements ExpressRouteConnectionList { + private ExpressRouteConnectionListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteConnectionListImpl( + ExpressRouteConnectionListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteConnectionListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java new file mode 100644 index 0000000000000..35ca064fd49a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java @@ -0,0 +1,1082 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteConnectionsClient. */ +public final class ExpressRouteConnectionsClientImpl implements ExpressRouteConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteConnectionInner putExpressRouteConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteConnectionParameters, + accept, + context); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context) + .getSyncPoller(); + } + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionInner get( + String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return getAsync(resourceGroupName, expressRouteGatewayName, connectionName).block(); + } + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRouteGatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { + return listAsync(resourceGroupName, expressRouteGatewayName).block(); + } + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + return listWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java new file mode 100644 index 0000000000000..5746bbc47ab82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnectionList; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteConnectionsImpl implements ExpressRouteConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionsImpl.class); + + private final ExpressRouteConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteConnectionsImpl( + ExpressRouteConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + ExpressRouteConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context) { + ExpressRouteConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + expressRouteGatewayName, + connectionName, + putExpressRouteConnectionParameters, + context); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteConnection get(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + ExpressRouteConnectionInner inner = + this.serviceClient().get(resourceGroupName, expressRouteGatewayName, connectionName); + if (inner != null) { + return new ExpressRouteConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, expressRouteGatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, connectionName); + } + + public void delete( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, connectionName, context); + } + + public ExpressRouteConnectionList list(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteConnectionListInner inner = this.serviceClient().list(resourceGroupName, expressRouteGatewayName); + if (inner != null) { + return new ExpressRouteConnectionListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, expressRouteGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteConnectionListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExpressRouteConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java new file mode 100644 index 0000000000000..30b6184945f37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRouteCrossConnectionImpl + implements ExpressRouteCrossConnection, ExpressRouteCrossConnection.Definition, ExpressRouteCrossConnection.Update { + private ExpressRouteCrossConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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..d5d97da967c0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java @@ -0,0 +1,1193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeeringList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionPeeringsClient. + */ +public final class ExpressRouteCrossConnectionPeeringsClientImpl implements ExpressRouteCrossConnectionPeeringsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCrossConnectionPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCrossConnectionPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCrossConnectionPeeringsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnectionPeerings to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCrossConnectionPeeringsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCrossConnectionPeeringInner peeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String crossConnectionName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, crossConnectionName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String crossConnectionName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, crossConnectionName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String crossConnectionName) { + return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName)); + } + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, crossConnectionName, context)); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String crossConnectionName, String peeringName) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionPeeringInner get( + String resourceGroupName, String crossConnectionName, String peeringName) { + return getAsync(resourceGroupName, crossConnectionName, peeringName).block(); + } + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + peeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..350ff56e55e6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeering; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCrossConnectionPeeringsImpl implements ExpressRouteCrossConnectionPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringsImpl.class); + + private final ExpressRouteCrossConnectionPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCrossConnectionPeeringsImpl( + ExpressRouteCrossConnectionPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String crossConnectionName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, crossConnectionName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, crossConnectionName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionPeeringImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName); + } + + public void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, crossConnectionName, peeringName, context); + } + + public ExpressRouteCrossConnectionPeering get( + String resourceGroupName, String crossConnectionName, String peeringName) { + ExpressRouteCrossConnectionPeeringInner inner = + this.serviceClient().get(resourceGroupName, crossConnectionName, peeringName); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, crossConnectionName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCrossConnectionPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + ExpressRouteCrossConnectionPeeringInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context) { + ExpressRouteCrossConnectionPeeringInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, context); + if (inner != null) { + return new ExpressRouteCrossConnectionPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + private ExpressRouteCrossConnectionPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java new file mode 100644 index 0000000000000..0b18adcd73f7a --- /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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient. */ +public final class ExpressRouteCrossConnectionsClientImpl implements ExpressRouteCrossConnectionsClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteCrossConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteCrossConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteCrossConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteCrossConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteCrossConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteCrossConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteCrossConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject crossConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listArpTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary" + + "/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTableSummary( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listRoutesTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("crossConnectionName") String crossConnectionName, + @PathParam("peeringName") String peeringName, + @PathParam("devicePath") String devicePath, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) { + return getByResourceGroupAsync(resourceGroupName, crossConnectionName).block(); + } + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName, context).block(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, String crossConnectionName, ExpressRouteCrossConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).getSyncPoller(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).getSyncPoller(); + } + + /** + * Update the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param parameters Parameters supplied to the update express route crossConnection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteCrossConnectionInner updateTags( + String resourceGroupName, String crossConnectionName, TagsObject crossConnectionParameters) { + return updateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).block(); + } + + /** + * Updates an express route cross connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the cross connection. + * @param crossConnectionParameters Parameters supplied to update express route cross connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteCrossConnection resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listArpTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource group + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTableSummary( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListRoutesTableSummaryAsync( + resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRoutesTable( + this.client.getEndpoint(), + resourceGroupName, + crossConnectionName, + peeringName, + devicePath, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable( + String resourceGroupName, + String crossConnectionName, + String peeringName, + String devicePath, + Context context) { + return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context) + .getSyncPoller(); + } + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..010fe871f1c2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsArpTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsArpTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitsRoutesTableListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnections; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteCrossConnectionsImpl implements ExpressRouteCrossConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionsImpl.class); + + private final ExpressRouteCrossConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteCrossConnectionsImpl( + ExpressRouteCrossConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCrossConnection getByResourceGroup(String resourceGroupName, String crossConnectionName) { + ExpressRouteCrossConnectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, crossConnectionName); + if (inner != null) { + return new ExpressRouteCrossConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteCrossConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsArpTableListResultInner inner = + this.serviceClient().listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsArpTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner inner = + this + .serviceClient() + .listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this.serviceClient().listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) { + ExpressRouteCircuitsRoutesTableListResultInner inner = + this + .serviceClient() + .listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, context); + if (inner != null) { + return new ExpressRouteCircuitsRoutesTableListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExpressRouteCrossConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = Utils.getValueFromIdByName(id, "expressRouteCrossConnections"); + if (crossConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'expressRouteCrossConnections'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, context); + } + + private ExpressRouteCrossConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteCrossConnectionImpl define(String name) { + return new ExpressRouteCrossConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java new file mode 100644 index 0000000000000..153898b8c502f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResult; +import java.util.Collections; +import java.util.List; + +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl + implements ExpressRouteCrossConnectionsRoutesTableSummaryListResult { + private ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCrossConnectionsRoutesTableSummaryListResultImpl( + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java new file mode 100644 index 0000000000000..fe0de4583efb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteConnection; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRouteGatewayImpl + implements ExpressRouteGateway, ExpressRouteGateway.Definition, ExpressRouteGateway.Update { + private ExpressRouteGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRouteGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String expressRouteGatewayName; + + private TagsObject updateExpressRouteGatewayParameters; + + public ExpressRouteGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRouteGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .createOrUpdate(resourceGroupName, expressRouteGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .createOrUpdate(resourceGroupName, expressRouteGatewayName, this.innerModel(), context); + return this; + } + + ExpressRouteGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRouteGatewayInner(); + this.serviceManager = serviceManager; + this.expressRouteGatewayName = name; + } + + public ExpressRouteGatewayImpl update() { + this.updateExpressRouteGatewayParameters = new TagsObject(); + return this; + } + + public ExpressRouteGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .updateTags( + resourceGroupName, expressRouteGatewayName, updateExpressRouteGatewayParameters, Context.NONE); + return this; + } + + public ExpressRouteGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .updateTags(resourceGroupName, expressRouteGatewayName, updateExpressRouteGatewayParameters, context); + return this; + } + + ExpressRouteGatewayImpl( + ExpressRouteGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRouteGatewayName = Utils.getValueFromIdByName(innerObject.id(), "expressRouteGateways"); + } + + public ExpressRouteGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRouteGateways() + .getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context) + .getValue(); + return this; + } + + public ExpressRouteGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRouteGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRouteGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateExpressRouteGatewayParameters.withTags(tags); + return this; + } + } + + public ExpressRouteGatewayImpl withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration) { + this.innerModel().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + public ExpressRouteGatewayImpl withVirtualHub(VirtualHubId virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java new file mode 100644 index 0000000000000..3da3af53a8f27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteGatewayListImpl implements ExpressRouteGatewayList { + private ExpressRouteGatewayListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteGatewayListImpl( + ExpressRouteGatewayListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ExpressRouteGatewayImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ExpressRouteGatewayListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java new file mode 100644 index 0000000000000..18475b9b1d519 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java @@ -0,0 +1,1426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteGatewaysClient. */ +public final class ExpressRouteGatewaysClientImpl implements ExpressRouteGatewaysClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ExpressRouteGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRouteGatewayInner putExpressRouteGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject expressRouteGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteGateways/{expressRouteGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRouteGatewayName") String expressRouteGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayListInner listBySubscription() { + return listBySubscriptionAsync().block(); + } + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBySubscriptionWithResponse(Context context) { + return listBySubscriptionWithResponseAsync(context).block(); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName) { + return listByResourceGroupAsync(resourceGroupName).block(); + } + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + this.client.getSubscriptionId(), + putExpressRouteGatewayParameters, + accept, + context); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a ExpressRoute gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param putExpressRouteGatewayParameters Parameters required in an ExpressRoute gateway PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + expressRouteGatewayName, + apiVersion, + expressRouteGatewayParameters, + accept, + context); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters) + .getSyncPoller(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, + String expressRouteGatewayName, + TagsObject expressRouteGatewayParameters, + Context context) { + return beginUpdateTagsAsync(resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Updates express route gateway tags. + * + * @param resourceGroupName The resource group name of the ExpressRouteGateway. + * @param expressRouteGatewayName The name of the gateway. + * @param expressRouteGatewayParameters Parameters supplied to update a virtual wan express route gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupAsync(resourceGroupName, expressRouteGatewayName).block(); + } + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName, context).block(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRouteGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRouteGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..820240a9873db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayList; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteGatewaysImpl implements ExpressRouteGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteGatewaysImpl.class); + + private final ExpressRouteGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteGatewaysImpl( + ExpressRouteGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteGatewayList listBySubscription() { + ExpressRouteGatewayListInner inner = this.serviceClient().listBySubscription(); + if (inner != null) { + return new ExpressRouteGatewayListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listBySubscriptionWithResponse(Context context) { + Response inner = this.serviceClient().listBySubscriptionWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteGatewayList listByResourceGroup(String resourceGroupName) { + ExpressRouteGatewayListInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new ExpressRouteGatewayListImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByResourceGroupWithResponse( + String resourceGroupName, Context context) { + Response inner = + this.serviceClient().listByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteGateway getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + ExpressRouteGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, expressRouteGatewayName); + if (inner != null) { + return new ExpressRouteGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName); + } + + public void delete(String resourceGroupName, String expressRouteGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRouteGatewayName, context); + } + + public ExpressRouteGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = Utils.getValueFromIdByName(id, "expressRouteGateways"); + if (expressRouteGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'expressRouteGateways'.", + id))); + } + this.delete(resourceGroupName, expressRouteGatewayName, context); + } + + private ExpressRouteGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRouteGatewayImpl define(String name) { + return new ExpressRouteGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java new file mode 100644 index 0000000000000..83503263925f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkConnectorType; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkMacSecConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRouteLinkImpl implements ExpressRouteLink { + private ExpressRouteLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteLinkImpl( + ExpressRouteLinkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String routerName() { + return this.innerModel().routerName(); + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public String patchPanelId() { + return this.innerModel().patchPanelId(); + } + + public String rackId() { + return this.innerModel().rackId(); + } + + public ExpressRouteLinkConnectorType connectorType() { + return this.innerModel().connectorType(); + } + + public ExpressRouteLinkAdminState adminState() { + return this.innerModel().adminState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.innerModel().macSecConfig(); + } + + public ExpressRouteLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java new file mode 100644 index 0000000000000..f1d0b9d477a13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteLinksClient. */ +public final class ExpressRouteLinksClientImpl implements ExpressRouteLinksClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ExpressRouteLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteLinks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @PathParam("linkName") String linkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}/links") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { + return getAsync(resourceGroupName, expressRoutePortName, linkName).block(); + } + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..524226c96c9b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteLinksImpl implements ExpressRouteLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinksImpl.class); + + private final ExpressRouteLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteLinksImpl( + ExpressRouteLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExpressRouteLink get(String resourceGroupName, String expressRoutePortName, String linkName) { + ExpressRouteLinkInner inner = this.serviceClient().get(resourceGroupName, expressRoutePortName, linkName); + if (inner != null) { + return new ExpressRouteLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, expressRoutePortName, linkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String expressRoutePortName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, expressRoutePortName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, expressRoutePortName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteLinkImpl(inner1, this.manager())); + } + + private ExpressRouteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..4dff32b32953d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +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 SubResource circuit() { + return this.innerModel().circuit(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + 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..603bcd814e6f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java @@ -0,0 +1,1202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(ExpressRoutePortAuthorizationsClientImpl.class); + + /** 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") + private 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRoutePortName, String authorizationName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRoutePortName, String authorizationName, Context context) { + return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, expressRoutePortName, authorizationName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String expressRoutePortName, + String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters) { + return 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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdate( + String resourceGroupName, + String expressRoutePortName, + String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters, + Context context) { + return 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String expressRoutePortName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..6999f83e0626d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRoutePortAuthorizationsImpl implements ExpressRoutePortAuthorizations { + @JsonIgnore private 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 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 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 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..c17cc942d0f96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLink; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ExpressRoutePortImpl + implements ExpressRoutePort, ExpressRoutePort.Definition, ExpressRoutePort.Update { + private ExpressRoutePortInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExpressRoutePortInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String expressRoutePortName; + + private TagsObject updateParameters; + + public ExpressRoutePortImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ExpressRoutePort create() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .createOrUpdate(resourceGroupName, expressRoutePortName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRoutePort create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .createOrUpdate(resourceGroupName, expressRoutePortName, this.innerModel(), context); + return this; + } + + ExpressRoutePortImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRoutePortInner(); + this.serviceManager = serviceManager; + this.expressRoutePortName = name; + } + + public ExpressRoutePortImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ExpressRoutePort apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .updateTagsWithResponse(resourceGroupName, expressRoutePortName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePort apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .updateTagsWithResponse(resourceGroupName, expressRoutePortName, updateParameters, context) + .getValue(); + return this; + } + + ExpressRoutePortImpl( + ExpressRoutePortInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = Utils.getValueFromIdByName(innerObject.id(), "ExpressRoutePorts"); + } + + public ExpressRoutePort refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePort refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExpressRoutePorts() + .getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context) + .getValue(); + return this; + } + + public ExpressRoutePortImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExpressRoutePortImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExpressRoutePortImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ExpressRoutePortImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ExpressRoutePortImpl withPeeringLocation(String peeringLocation) { + this.innerModel().withPeeringLocation(peeringLocation); + return this; + } + + public ExpressRoutePortImpl withBandwidthInGbps(Integer bandwidthInGbps) { + this.innerModel().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + public ExpressRoutePortImpl withEncapsulation(ExpressRoutePortsEncapsulation encapsulation) { + this.innerModel().withEncapsulation(encapsulation); + return this; + } + + public ExpressRoutePortImpl withLinks(List links) { + this.innerModel().withLinks(links); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java new file mode 100644 index 0000000000000..e402e6ea6715b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java @@ -0,0 +1,1650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortListResult; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsClient. */ +public final class ExpressRoutePortsClientImpl implements ExpressRoutePortsClient { + private final ClientLogger logger = new ClientLogger(ExpressRoutePortsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRoutePortsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRoutePortsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ExpressRoutePortsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRoutePorts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRoutePortsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") ExpressRoutePortInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts/{expressRoutePortName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ExpressRoutePorts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRoutePorts/{expressRoutePortName}/generateLoa") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateLoa( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @BodyParam("application/json") GenerateExpressRoutePortsLoaRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String expressRoutePortName, Context context) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName, context).getSyncPoller(); + } + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupAsync(resourceGroupName, expressRoutePortName).block(); + } + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to the create ExpressRoutePort operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner updateTags( + String resourceGroupName, String expressRoutePortName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, expressRoutePortName, parameters).block(); + } + + /** + * Update ExpressRoutePort tags. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param parameters Parameters supplied to update ExpressRoutePort resource tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateExpressRoutePortsLoaResultInner generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + return generateLoaAsync(resourceGroupName, expressRoutePortName, request).block(); + } + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..6a6e8719b9303 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRoutePortsImpl implements ExpressRoutePorts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsImpl.class); + + private final ExpressRoutePortsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRoutePortsImpl( + ExpressRoutePortsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String expressRoutePortName) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName); + } + + public void delete(String resourceGroupName, String expressRoutePortName, Context context) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName, context); + } + + public ExpressRoutePort getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + ExpressRoutePortInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, expressRoutePortName); + if (inner != null) { + return new ExpressRoutePortImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRoutePortImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public GenerateExpressRoutePortsLoaResult generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + GenerateExpressRoutePortsLoaResultInner inner = + this.serviceClient().generateLoa(resourceGroupName, expressRoutePortName, request); + if (inner != null) { + return new GenerateExpressRoutePortsLoaResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context) { + Response inner = + this.serviceClient().generateLoaWithResponse(resourceGroupName, expressRoutePortName, request, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GenerateExpressRoutePortsLoaResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRoutePort getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = Utils.getValueFromIdByName(id, "ExpressRoutePorts"); + if (expressRoutePortName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ExpressRoutePorts'.", id))); + } + this.delete(resourceGroupName, expressRoutePortName, context); + } + + private ExpressRoutePortsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRoutePortImpl define(String name) { + return new ExpressRoutePortImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.java new file mode 100644 index 0000000000000..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..31d601969b813 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRoutePortsLocationsClient. */ +public final class ExpressRoutePortsLocationsClientImpl implements ExpressRoutePortsLocationsClient { + private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRoutePortsLocationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortsLocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRoutePortsLocationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRoutePortsLocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRoutePortsLocations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRoutePortsLocationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("locationName") String locationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. + * Available bandwidths can only be obtained when retrieving a specific peering location. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortsLocationInner get(String locationName) { + return getAsync(locationName).block(); + } + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, Context context) { + return getWithResponseAsync(locationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..00b5f2a4b688a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocation; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRoutePortsLocationsImpl implements ExpressRoutePortsLocations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationsImpl.class); + + private final ExpressRoutePortsLocationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRoutePortsLocationsImpl( + ExpressRoutePortsLocationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public ExpressRoutePortsLocation get(String locationName) { + ExpressRoutePortsLocationInner inner = this.serviceClient().get(locationName); + if (inner != null) { + return new ExpressRoutePortsLocationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String locationName, Context context) { + Response inner = this.serviceClient().getWithResponse(locationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRoutePortsLocationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExpressRoutePortsLocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.java new file mode 100644 index 0000000000000..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..cc7eb086169d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExpressRouteServiceProvidersClient. */ +public final class ExpressRouteServiceProvidersClientImpl implements ExpressRouteServiceProvidersClient { + private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExpressRouteServiceProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteServiceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteServiceProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ExpressRouteServiceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteServiceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ExpressRouteServiceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the available express route service providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListExpressRouteServiceProvider API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..57cb6e25fc1bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProvider; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExpressRouteServiceProvidersImpl implements ExpressRouteServiceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProvidersImpl.class); + + private final ExpressRouteServiceProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteServiceProvidersImpl( + ExpressRouteServiceProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + private ExpressRouteServiceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..d08d89af74665 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FirewallPoliciesClient. */ +public final class FirewallPoliciesClientImpl implements FirewallPoliciesClient { + private final ClientLogger logger = new ClientLogger(FirewallPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FirewallPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(FirewallPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FirewallPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FirewallPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String firewallPolicyName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String firewallPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String firewallPolicyName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyInner getByResourceGroup(String resourceGroupName, String firewallPolicyName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, firewallPolicyName, expand).block(); + } + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to the create or update Firewall Policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return firewallPolicy Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Firewall Policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..e7931690efcaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicies; +import com.azure.resourcemanager.network.generated.models.FirewallPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPoliciesImpl implements FirewallPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPoliciesImpl.class); + + private final FirewallPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPoliciesImpl( + FirewallPoliciesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String firewallPolicyName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName); + } + + public void delete(String resourceGroupName, String firewallPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, context); + } + + public FirewallPolicy getByResourceGroup(String resourceGroupName, String firewallPolicyName) { + FirewallPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, firewallPolicyName); + if (inner != null) { + return new FirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public FirewallPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + this.delete(resourceGroupName, firewallPolicyName, context); + } + + private FirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyImpl define(String name) { + return new FirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..f89a54d8d343c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.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.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(FirewallPolicyIdpsSignaturesClientImpl.class); + + /** 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") + private 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, + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, firewallPolicyName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } +} 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..112e8874a57b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.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.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.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(FirewallPolicyIdpsSignaturesFilterValuesClientImpl.class); + + /** 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") + private 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, + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, firewallPolicyName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } +} 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..0a42171631350 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPolicyIdpsSignaturesFilterValuesImpl implements FirewallPolicyIdpsSignaturesFilterValues { + @JsonIgnore + private 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 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; + } + } + + 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; + } + } + + 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..9d54428f8a475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPolicyIdpsSignaturesImpl implements FirewallPolicyIdpsSignatures { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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..6ed69ec4df320 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesClientImpl.java @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated 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.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(FirewallPolicyIdpsSignaturesOverridesClientImpl.class); + + /** 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") + private 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, + @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, + @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, + @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, + @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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 patchAsync(resourceGroupName, firewallPolicyName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 putAsync(resourceGroupName, firewallPolicyName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, firewallPolicyName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + this.client.getSubscriptionId(), + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, firewallPolicyName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } +} 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..130c3101e6915 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPolicyIdpsSignaturesOverridesImpl implements FirewallPolicyIdpsSignaturesOverrides { + @JsonIgnore private 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 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 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 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 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 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 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 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; + } + } + + 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; + } + } + + 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..dd97a48b27a16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.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.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.ExplicitProxySettings; +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 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 ExplicitProxySettings explicitProxySettings() { + return this.innerModel().explicitProxySettings(); + } + + 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 FirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String firewallPolicyName; + + public FirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FirewallPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), context); + return this; + } + + FirewallPolicyImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new FirewallPolicyInner(); + this.serviceManager = serviceManager; + this.firewallPolicyName = name; + } + + public FirewallPolicyImpl update() { + return this; + } + + public FirewallPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .createOrUpdate(resourceGroupName, firewallPolicyName, this.innerModel(), context); + return this; + } + + FirewallPolicyImpl( + FirewallPolicyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + } + + public FirewallPolicy refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicy refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, localExpand, context) + .getValue(); + return this; + } + + public FirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FirewallPolicyImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public FirewallPolicyImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public FirewallPolicyImpl withBasePolicy(SubResource basePolicy) { + this.innerModel().withBasePolicy(basePolicy); + return this; + } + + public FirewallPolicyImpl withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + this.innerModel().withThreatIntelMode(threatIntelMode); + return this; + } + + public FirewallPolicyImpl withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist) { + this.innerModel().withThreatIntelWhitelist(threatIntelWhitelist); + return this; + } + + public FirewallPolicyImpl withInsights(FirewallPolicyInsights insights) { + this.innerModel().withInsights(insights); + return this; + } + + public FirewallPolicyImpl withSnat(FirewallPolicySnat snat) { + this.innerModel().withSnat(snat); + return this; + } + + public FirewallPolicyImpl withSql(FirewallPolicySql sql) { + this.innerModel().withSql(sql); + return this; + } + + public FirewallPolicyImpl withDnsSettings(DnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public FirewallPolicyImpl withExplicitProxySettings(ExplicitProxySettings explicitProxySettings) { + this.innerModel().withExplicitProxySettings(explicitProxySettings); + return this; + } + + public FirewallPolicyImpl withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection) { + this.innerModel().withIntrusionDetection(intrusionDetection); + return this; + } + + public FirewallPolicyImpl withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity) { + this.innerModel().withTransportSecurity(transportSecurity); + return this; + } + + public FirewallPolicyImpl withSku(FirewallPolicySku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java new file mode 100644 index 0000000000000..7e5fa7b12f58a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class FirewallPolicyRuleCollectionGroupImpl + implements FirewallPolicyRuleCollectionGroup, + FirewallPolicyRuleCollectionGroup.Definition, + FirewallPolicyRuleCollectionGroup.Update { + private FirewallPolicyRuleCollectionGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public List ruleCollections() { + List inner = this.innerModel().ruleCollections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public FirewallPolicyRuleCollectionGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String firewallPolicyName; + + private String ruleCollectionGroupName; + + public FirewallPolicyRuleCollectionGroupImpl withExistingFirewallPolicy( + String resourceGroupName, String firewallPolicyName) { + this.resourceGroupName = resourceGroupName; + this.firewallPolicyName = firewallPolicyName; + return this; + } + + public FirewallPolicyRuleCollectionGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicyRuleCollectionGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), context); + return this; + } + + FirewallPolicyRuleCollectionGroupImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new FirewallPolicyRuleCollectionGroupInner(); + this.serviceManager = serviceManager; + this.ruleCollectionGroupName = name; + } + + public FirewallPolicyRuleCollectionGroupImpl update() { + return this; + } + + public FirewallPolicyRuleCollectionGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), Context.NONE); + return this; + } + + public FirewallPolicyRuleCollectionGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .createOrUpdate( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, this.innerModel(), context); + return this; + } + + FirewallPolicyRuleCollectionGroupImpl( + FirewallPolicyRuleCollectionGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = Utils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + this.ruleCollectionGroupName = Utils.getValueFromIdByName(innerObject.id(), "ruleCollectionGroups"); + } + + public FirewallPolicyRuleCollectionGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallPolicyRuleCollectionGroups() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .getValue(); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public FirewallPolicyRuleCollectionGroupImpl withRuleCollections( + List ruleCollections) { + this.innerModel().withRuleCollections(ruleCollections); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java new file mode 100644 index 0000000000000..3933aa24e2e72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java @@ -0,0 +1,1192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyRuleCollectionGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyRuleCollectionGroupsClient. + */ +public final class FirewallPolicyRuleCollectionGroupsClientImpl implements FirewallPolicyRuleCollectionGroupsClient { + private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FirewallPolicyRuleCollectionGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyRuleCollectionGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyRuleCollectionGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + FirewallPolicyRuleCollectionGroupsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyRuleCollectionGroups to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FirewallPolicyRuleCollectionGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FirewallPolicyRuleCollectionGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).getSyncPoller(); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyRuleCollectionGroupInner get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + return getAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName).block(); + } + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + ruleCollectionGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate( + String resourceGroupName, + String firewallPolicyName, + String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param parameters Parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return rule Collection Group resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + firewallPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String firewallPolicyName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, firewallPolicyName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String firewallPolicyName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, firewallPolicyName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String firewallPolicyName) { + return new PagedIterable<>(listAsync(resourceGroupName, firewallPolicyName)); + } + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, firewallPolicyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..ed33afbf87125 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyRuleCollectionGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroup; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallPolicyRuleCollectionGroupsImpl implements FirewallPolicyRuleCollectionGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupsImpl.class); + + private final FirewallPolicyRuleCollectionGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyRuleCollectionGroupsImpl( + FirewallPolicyRuleCollectionGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + } + + public void delete( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + public FirewallPolicyRuleCollectionGroup get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + FirewallPolicyRuleCollectionGroupInner inner = + this.serviceClient().get(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + if (inner != null) { + return new FirewallPolicyRuleCollectionGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FirewallPolicyRuleCollectionGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String firewallPolicyName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, firewallPolicyName); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, firewallPolicyName, context); + return Utils.mapPage(inner, inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public FirewallPolicyRuleCollectionGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this + .getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + return this.getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = Utils.getValueFromIdByName(id, "firewallPolicies"); + if (firewallPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'firewallPolicies'.", id))); + } + String ruleCollectionGroupName = Utils.getValueFromIdByName(id, "ruleCollectionGroups"); + if (ruleCollectionGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ruleCollectionGroups'.", + id))); + } + this.delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + private FirewallPolicyRuleCollectionGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FirewallPolicyRuleCollectionGroupImpl define(String name) { + return new FirewallPolicyRuleCollectionGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java new file mode 100644 index 0000000000000..ea76ea4b828c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import java.util.Collections; +import java.util.Map; + +public final class FlowLogImpl implements FlowLog, FlowLog.Definition, FlowLog.Update { + private FlowLogInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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..3a8d24815f9ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java @@ -0,0 +1,1337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.FlowLogsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLogListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FlowLogsClient. */ +public final class FlowLogsClientImpl implements FlowLogsClient { + private final ClientLogger logger = new ClientLogger(FlowLogsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FlowLogsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FlowLogsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlowLogsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FlowLogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFlowLogs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface FlowLogsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("flowLogName") String flowLogName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/flowLogs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + flowLogName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, String networkWatcherName, String flowLogName, FlowLogInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).getSyncPoller(); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInner> beginCreateOrUpdate( + String resourceGroupName, + String networkWatcherName, + String flowLogName, + FlowLogInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkWatcherName, flowLogName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update a flow log for the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters that define the create or update flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner updateTags( + String resourceGroupName, String networkWatcherName, String flowLogName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, flowLogName, parameters).block(); + } + + /** + * Update tags of the specified flow log. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log. + * @param parameters Parameters supplied to update flow log tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowLogInner get(String resourceGroupName, String networkWatcherName, String flowLogName) { + return getAsync(resourceGroupName, networkWatcherName, flowLogName).block(); + } + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName).getSyncPoller(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, flowLogName, context).getSyncPoller(); + } + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkWatcherName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkWatcherName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..e5d771f3515c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.FlowLogsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.FlowLogs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FlowLogsImpl implements FlowLogs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogsImpl.class); + + private final FlowLogsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FlowLogsImpl( + FlowLogsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public FlowLog get(String resourceGroupName, String networkWatcherName, String flowLogName) { + FlowLogInner inner = this.serviceClient().get(resourceGroupName, networkWatcherName, flowLogName); + if (inner != null) { + return new FlowLogImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FlowLogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, flowLogName); + } + + public void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, flowLogName, context); + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public FlowLog getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, networkWatcherName, flowLogName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + String flowLogName = Utils.getValueFromIdByName(id, "flowLogs"); + if (flowLogName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowLogs'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, flowLogName, context); + } + + private FlowLogsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public FlowLogImpl define(String name) { + return new FlowLogImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java new file mode 100644 index 0000000000000..29fee3d0da41c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import java.util.Collections; +import java.util.List; + +public final class FrontendIpConfigurationImpl implements FrontendIpConfiguration { + private FrontendIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FrontendIpConfigurationImpl( + FrontendIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List inboundNatPools() { + List inner = this.innerModel().inboundNatPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List outboundRules() { + List inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource publicIpPrefix() { + return this.innerModel().publicIpPrefix(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public FrontendIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..91246a713bc8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.HubIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class HubIpConfigurationImpl + implements HubIpConfiguration, HubIpConfiguration.Definition, HubIpConfiguration.Update { + private HubIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String ipConfigName; + + public HubIpConfigurationImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public HubIpConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), Context.NONE); + return this; + } + + public HubIpConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), context); + return this; + } + + HubIpConfigurationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new HubIpConfigurationInner(); + this.serviceManager = serviceManager; + this.ipConfigName = name; + } + + public HubIpConfigurationImpl update() { + return this; + } + + public HubIpConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), Context.NONE); + return this; + } + + public HubIpConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .createOrUpdate(resourceGroupName, virtualHubName, ipConfigName, this.innerModel(), context); + return this; + } + + HubIpConfigurationImpl( + HubIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.ipConfigName = Utils.getValueFromIdByName(innerObject.id(), "ipConfigurations"); + } + + public HubIpConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE) + .getValue(); + return this; + } + + public HubIpConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubIpConfigurations() + .getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context) + .getValue(); + return this; + } + + public HubIpConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAddress(String privateIpAddress) { + this.innerModel().withPrivateIpAddress(privateIpAddress); + return this; + } + + public HubIpConfigurationImpl withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.innerModel().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + public HubIpConfigurationImpl withSubnet(SubnetInner subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public HubIpConfigurationImpl withPublicIpAddress(PublicIpAddressInner publicIpAddress) { + this.innerModel().withPublicIpAddress(publicIpAddress); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..208d142ef5501 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.HubRouteTable; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class HubRouteTableImpl implements HubRouteTable, HubRouteTable.Definition, HubRouteTable.Update { + private HubRouteTableInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List associatedConnections() { + List inner = this.innerModel().associatedConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List propagatingConnections() { + List inner = this.innerModel().propagatingConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubRouteTableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String routeTableName; + + public HubRouteTableImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public HubRouteTable create() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), Context.NONE); + return this; + } + + public HubRouteTable create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), context); + return this; + } + + HubRouteTableImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new HubRouteTableInner(); + this.serviceManager = serviceManager; + this.routeTableName = name; + } + + public HubRouteTableImpl update() { + return this; + } + + public HubRouteTable apply() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), Context.NONE); + return this; + } + + public HubRouteTable apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, this.innerModel(), context); + return this; + } + + HubRouteTableImpl( + HubRouteTableInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "hubRouteTables"); + } + + public HubRouteTable refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE) + .getValue(); + return this; + } + + public HubRouteTable refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHubRouteTables() + .getWithResponse(resourceGroupName, virtualHubName, routeTableName, context) + .getValue(); + return this; + } + + public HubRouteTableImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public HubRouteTableImpl withRoutes(List routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public HubRouteTableImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java new file mode 100644 index 0000000000000..974f980d5f0c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java @@ -0,0 +1,1156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.HubRouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.ListHubRouteTablesResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HubRouteTablesClient. */ +public final class HubRouteTablesClientImpl implements HubRouteTablesClient { + private final ClientLogger logger = new ClientLogger(HubRouteTablesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final HubRouteTablesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubRouteTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HubRouteTablesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(HubRouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientHubRouteTables to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface HubRouteTablesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubRouteTableInner routeTableParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubRouteTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + routeTableParameters, + accept, + context); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeTableName, routeTableParameters) + .getSyncPoller(); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + HubRouteTableInner routeTableParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, routeTableParameters, context) + .getSyncPoller(); + } + + /** + * Creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param routeTableParameters Parameters supplied to create or update RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubRouteTableInner get(String resourceGroupName, String virtualHubName, String routeTableName) { + return getAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).getSyncPoller(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..83f64fe28d701 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.HubRouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.azure.resourcemanager.network.generated.models.HubRouteTable; +import com.azure.resourcemanager.network.generated.models.HubRouteTables; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class HubRouteTablesImpl implements HubRouteTables { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRouteTablesImpl.class); + + private final HubRouteTablesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public HubRouteTablesImpl( + HubRouteTablesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubRouteTable get(String resourceGroupName, String virtualHubName, String routeTableName) { + HubRouteTableInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routeTableName); + if (inner != null) { + return new HubRouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubRouteTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public HubRouteTable getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "hubRouteTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'hubRouteTables'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + private HubRouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubRouteTableImpl define(String name) { + return new HubRouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java new file mode 100644 index 0000000000000..3abf014d6dbb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; + +public final class HubVirtualNetworkConnectionImpl implements HubVirtualNetworkConnection { + private HubVirtualNetworkConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + HubVirtualNetworkConnectionImpl( + HubVirtualNetworkConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVirtualNetwork() { + return this.innerModel().remoteVirtualNetwork(); + } + + public Boolean allowHubToRemoteVnetTransit() { + return this.innerModel().allowHubToRemoteVnetTransit(); + } + + public Boolean allowRemoteVnetToUseHubVnetGateways() { + return this.innerModel().allowRemoteVnetToUseHubVnetGateways(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubVirtualNetworkConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java new file mode 100644 index 0000000000000..f497f5ca53a93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.HubVirtualNetworkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListHubVirtualNetworkConnectionsResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HubVirtualNetworkConnectionsClient. */ +public final class HubVirtualNetworkConnectionsClientImpl implements HubVirtualNetworkConnectionsClient { + private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final HubVirtualNetworkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of HubVirtualNetworkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HubVirtualNetworkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + HubVirtualNetworkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientHubVirtualNetworkConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface HubVirtualNetworkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/hubVirtualNetworkConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + hubVirtualNetworkConnectionParameters, + accept, + context); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context) + .getSyncPoller(); + } + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName).getSyncPoller(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubVirtualNetworkConnectionInner get( + String resourceGroupName, String virtualHubName, String connectionName) { + return getAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource 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 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..9bdd427e62a5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.HubVirtualNetworkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnection; +import com.azure.resourcemanager.network.generated.models.HubVirtualNetworkConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class HubVirtualNetworkConnectionsImpl implements HubVirtualNetworkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubVirtualNetworkConnectionsImpl.class); + + private final HubVirtualNetworkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public HubVirtualNetworkConnectionsImpl( + HubVirtualNetworkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + HubVirtualNetworkConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context) { + HubVirtualNetworkConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters, context); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName); + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName, context); + } + + public HubVirtualNetworkConnection get(String resourceGroupName, String virtualHubName, String connectionName) { + HubVirtualNetworkConnectionInner inner = + this.serviceClient().get(resourceGroupName, virtualHubName, connectionName); + if (inner != null) { + return new HubVirtualNetworkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubVirtualNetworkConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubVirtualNetworkConnectionImpl(inner1, this.manager())); + } + + private HubVirtualNetworkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java new file mode 100644 index 0000000000000..a9672d29b9355 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 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..3efa79c65689b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java @@ -0,0 +1,1213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.InboundNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in InboundNatRulesClient. */ +public final class InboundNatRulesClientImpl implements InboundNatRulesClient { + private final ClientLogger logger = new ClientLogger(InboundNatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final InboundNatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundNatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InboundNatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(InboundNatRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientInboundNatRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface InboundNatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("inboundNatRuleName") String inboundNatRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") InboundNatRuleInner inboundNatRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InboundNatRuleInner get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + final String expand = null; + return getAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand).block(); + } + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + inboundNatRuleName, + apiVersion, + this.client.getSubscriptionId(), + inboundNatRuleParameters, + accept, + context); + } + + /** + * Creates or updates a load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound NAT rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound NAT rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param inboundNatRuleParameters Parameters supplied to the create or update inbound NAT rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return inbound NAT rule of the load balancer 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..33caeb153e52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.InboundNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.InboundNatRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class InboundNatRulesImpl implements InboundNatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRulesImpl.class); + + private final InboundNatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public InboundNatRulesImpl( + InboundNatRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new InboundNatRuleImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName); + } + + public void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + public InboundNatRule get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName) { + InboundNatRuleInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, inboundNatRuleName); + if (inner != null) { + return new InboundNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new InboundNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InboundNatRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String inboundNatRuleName = Utils.getValueFromIdByName(id, "inboundNatRules"); + if (inboundNatRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'inboundNatRules'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, inboundNatRuleName, context); + } + + private InboundNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundNatRuleImpl define(String name) { + return new InboundNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java new file mode 100644 index 0000000000000..c74da03335f5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRule; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class InboundSecurityRuleImpl + implements InboundSecurityRule, InboundSecurityRule.Definition, InboundSecurityRule.Update { + private InboundSecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InboundSecurityRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private String ruleCollectionName; + + public InboundSecurityRuleImpl withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName) { + this.resourceGroupName = resourceGroupName; + this.networkVirtualApplianceName = networkVirtualApplianceName; + return this; + } + + public InboundSecurityRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public InboundSecurityRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, this.innerModel(), context); + return this; + } + + InboundSecurityRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new InboundSecurityRuleInner(); + this.serviceManager = serviceManager; + this.ruleCollectionName = name; + } + + public InboundSecurityRuleImpl update() { + return this; + } + + public InboundSecurityRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public InboundSecurityRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getInboundSecurityRuleOperations() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, this.innerModel(), context); + return this; + } + + InboundSecurityRuleImpl( + InboundSecurityRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.ruleCollectionName = Utils.getValueFromIdByName(innerObject.id(), "inboundSecurityRules"); + } + + public InboundSecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundSecurityRuleImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java new file mode 100644 index 0000000000000..3ff74c5baa232 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in InboundSecurityRuleOperationsClient. */ +public final class InboundSecurityRuleOperationsClientImpl implements InboundSecurityRuleOperationsClient { + private final ClientLogger logger = new ClientLogger(InboundSecurityRuleOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final InboundSecurityRuleOperationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of InboundSecurityRuleOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InboundSecurityRuleOperationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + InboundSecurityRuleOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientInboundSecurityRuleOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface InboundSecurityRuleOperationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("ruleCollectionName") String ruleCollectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") InboundSecurityRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + ruleCollectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String ruleCollectionName, + InboundSecurityRuleInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Inbound Security Rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param ruleCollectionName The name of security rule collection. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nVA Inbound Security Rule resource 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..9ccf042163699 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class InboundSecurityRuleOperationsImpl implements InboundSecurityRuleOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRuleOperationsImpl.class); + + private final InboundSecurityRuleOperationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public InboundSecurityRuleOperationsImpl( + InboundSecurityRuleOperationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + private InboundSecurityRuleOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public InboundSecurityRuleImpl define(String name) { + return new InboundSecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java new file mode 100644 index 0000000000000..9acfd5a78fa45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.models.IpAddressAvailabilityResult; +import java.util.Collections; +import java.util.List; + +public final class IpAddressAvailabilityResultImpl implements IpAddressAvailabilityResult { + private IpAddressAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpAddressAvailabilityResultImpl( + IpAddressAvailabilityResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean available() { + return this.innerModel().available(); + } + + public List availableIpAddresses() { + List inner = this.innerModel().availableIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isPlatformReserved() { + return this.innerModel().isPlatformReserved(); + } + + public IpAddressAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java new file mode 100644 index 0000000000000..17a8ac5804c96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class IpAllocationImpl implements IpAllocation, IpAllocation.Definition, IpAllocation.Update { + private IpAllocationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..58e55c9f55abc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java @@ -0,0 +1,1492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.IpAllocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpAllocationsClient. */ +public final class IpAllocationsClientImpl implements IpAllocationsClient { + private final ClientLogger logger = new ClientLogger(IpAllocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpAllocationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of IpAllocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpAllocationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(IpAllocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientIpAllocations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface IpAllocationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IpAllocationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations/{ipAllocationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipAllocationName") String ipAllocationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/IpAllocations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipAllocationName) { + return beginDeleteAsync(resourceGroupName, ipAllocationName).getSyncPoller(); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String ipAllocationName, Context context) { + return beginDeleteAsync(resourceGroupName, ipAllocationName, context).getSyncPoller(); + } + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String ipAllocationName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner getByResourceGroup(String resourceGroupName, String ipAllocationName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, ipAllocationName, expand).block(); + } + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipAllocationName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate( + String resourceGroupName, String ipAllocationName, IpAllocationInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipAllocationName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an IpAllocation in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAllocationInner updateTags(String resourceGroupName, String ipAllocationName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, ipAllocationName, parameters).block(); + } + + /** + * Updates a IpAllocation tags. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param parameters Parameters supplied to update IpAllocation tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipAllocation resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all IpAllocations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpAllocations API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..4d36daab979ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.IpAllocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import com.azure.resourcemanager.network.generated.models.IpAllocations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpAllocationsImpl implements IpAllocations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationsImpl.class); + + private final IpAllocationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public IpAllocationsImpl( + IpAllocationsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String ipAllocationName) { + this.serviceClient().delete(resourceGroupName, ipAllocationName); + } + + public void delete(String resourceGroupName, String ipAllocationName, Context context) { + this.serviceClient().delete(resourceGroupName, ipAllocationName, context); + } + + public IpAllocation getByResourceGroup(String resourceGroupName, String ipAllocationName) { + IpAllocationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipAllocationName); + if (inner != null) { + return new IpAllocationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpAllocationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public IpAllocation getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = Utils.getValueFromIdByName(id, "IpAllocations"); + if (ipAllocationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'IpAllocations'.", id))); + } + this.delete(resourceGroupName, ipAllocationName, context); + } + + private IpAllocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpAllocationImpl define(String name) { + return new IpAllocationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java new file mode 100644 index 0000000000000..94b3d94e69eff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationImpl implements IpConfiguration { + private IpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationImpl( + IpConfigurationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java new file mode 100644 index 0000000000000..cf80d21f457c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationProfileImpl implements IpConfigurationProfile { + private IpConfigurationProfileInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationProfileImpl( + IpConfigurationProfileInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public IpConfigurationProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..d6a1984607ee9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.IpGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class IpGroupImpl implements IpGroup, IpGroup.Definition, IpGroup.Update { + private IpGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..8d79717971246 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java @@ -0,0 +1,1470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.IpGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.IpGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpGroupsClient. */ +public final class IpGroupsClientImpl implements IpGroupsClient { + private final ClientLogger logger = new ClientLogger(IpGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of IpGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(IpGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientIpGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface IpGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IpGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> updateGroups( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups" + + "/{ipGroupsName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("ipGroupsName") String ipGroupsName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipGroupsName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner getByResourceGroup(String resourceGroupName, String ipGroupsName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, ipGroupsName, expand).block(); + } + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + ipGroupsName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @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 IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @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 IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpGroupInner> beginCreateOrUpdate( + String resourceGroupName, String ipGroupsName, IpGroupInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, ipGroupsName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an ipGroups in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the create or update IpGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpGroupInner updateGroups(String resourceGroupName, String ipGroupsName, TagsObject parameters) { + return updateGroupsAsync(resourceGroupName, ipGroupsName, parameters).block(); + } + + /** + * Updates tags of an IpGroups resource. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param parameters Parameters supplied to the update ipGroups operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IpGroups resource information 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipGroupsName) { + return beginDeleteAsync(resourceGroupName, ipGroupsName).getSyncPoller(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String ipGroupsName, Context context) { + return beginDeleteAsync(resourceGroupName, ipGroupsName, context).getSyncPoller(); + } + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all IpGroups in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpGroups API service call 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 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 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 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..da85761bfb02d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.IpGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.azure.resourcemanager.network.generated.models.IpGroup; +import com.azure.resourcemanager.network.generated.models.IpGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpGroupsImpl implements IpGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupsImpl.class); + + private final IpGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public IpGroupsImpl( + IpGroupsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IpGroup getByResourceGroup(String resourceGroupName, String ipGroupsName) { + IpGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, ipGroupsName); + if (inner != null) { + return new IpGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String ipGroupsName) { + this.serviceClient().delete(resourceGroupName, ipGroupsName); + } + + public void delete(String resourceGroupName, String ipGroupsName, Context context) { + this.serviceClient().delete(resourceGroupName, ipGroupsName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public IpGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = Utils.getValueFromIdByName(id, "ipGroups"); + if (ipGroupsName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ipGroups'.", id))); + } + this.delete(resourceGroupName, ipGroupsName, context); + } + + private IpGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public IpGroupImpl define(String name) { + return new IpGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java new file mode 100644 index 0000000000000..f663330939393 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerBackendAddressPoolsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPoolListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerBackendAddressPoolsClient. */ +public final class LoadBalancerBackendAddressPoolsClientImpl implements LoadBalancerBackendAddressPoolsClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerBackendAddressPoolsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerBackendAddressPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerBackendAddressPoolsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerBackendAddressPoolsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerBackendAddressPools to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerBackendAddressPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackendAddressPoolInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendAddressPoolName") String backendAddressPoolName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressPoolInner get( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return getAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).block(); + } + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + backendAddressPoolName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @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 pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @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 pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String loadBalancerName, + String backendAddressPoolName, + BackendAddressPoolInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, loadBalancerName, backendAddressPoolName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param parameters Parameters supplied to the create or update load balancer backend address pool operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pool of backend IP addresses 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..e8406f1049d91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerBackendAddressPoolsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerBackendAddressPoolsImpl implements LoadBalancerBackendAddressPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolsImpl.class); + + private final LoadBalancerBackendAddressPoolsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerBackendAddressPoolsImpl( + LoadBalancerBackendAddressPoolsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + public BackendAddressPool get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + BackendAddressPoolInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, backendAddressPoolName); + if (inner != null) { + return new BackendAddressPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackendAddressPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String loadBalancerName, String backendAddressPoolName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, backendAddressPoolName); + } + + public void delete( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + public BackendAddressPool getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this + .getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + return this.getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = Utils.getValueFromIdByName(id, "loadBalancers"); + if (loadBalancerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loadBalancers'.", id))); + } + String backendAddressPoolName = Utils.getValueFromIdByName(id, "backendAddressPools"); + if (backendAddressPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'backendAddressPools'.", id))); + } + this.delete(resourceGroupName, loadBalancerName, backendAddressPoolName, context); + } + + private LoadBalancerBackendAddressPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BackendAddressPoolImpl define(String name) { + return new BackendAddressPoolImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..1331d49ba20dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerFrontendIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * LoadBalancerFrontendIpConfigurationsClient. + */ +public final class LoadBalancerFrontendIpConfigurationsClientImpl + implements LoadBalancerFrontendIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerFrontendIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerFrontendIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerFrontendIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerFrontendIpConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerFrontendIpConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerFrontendIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("frontendIPConfigurationName") String frontendIpConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FrontendIpConfigurationInner get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + return getAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName).block(); + } + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFrontendIPConfiguration API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..1c72bee41b6ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerFrontendIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.LoadBalancerFrontendIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerFrontendIpConfigurationsImpl implements LoadBalancerFrontendIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationsImpl.class); + + private final LoadBalancerFrontendIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerFrontendIpConfigurationsImpl( + LoadBalancerFrontendIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + public FrontendIpConfiguration get( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName) { + FrontendIpConfigurationInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, frontendIpConfigurationName); + if (inner != null) { + return new FrontendIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, loadBalancerName, frontendIpConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FrontendIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerFrontendIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java new file mode 100644 index 0000000000000..d84277110e2e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.LoadBalancingRule; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class LoadBalancerImpl implements LoadBalancer, LoadBalancer.Definition, LoadBalancer.Update { + private LoadBalancerInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public LoadBalancerSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..a5a46dc2b0c10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java @@ -0,0 +1,537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerLoadBalancingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerLoadBalancingRulesClient. */ +public final class LoadBalancerLoadBalancingRulesClientImpl implements LoadBalancerLoadBalancingRulesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerLoadBalancingRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerLoadBalancingRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerLoadBalancingRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerLoadBalancingRulesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerLoadBalancingRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerLoadBalancingRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/loadBalancingRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("loadBalancingRuleName") String loadBalancingRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancingRuleInner get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + return getAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName).block(); + } + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancingRule API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..d37b6a319e205 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerLoadBalancingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerLoadBalancingRules; +import com.azure.resourcemanager.network.generated.models.LoadBalancingRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerLoadBalancingRulesImpl implements LoadBalancerLoadBalancingRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRulesImpl.class); + + private final LoadBalancerLoadBalancingRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerLoadBalancingRulesImpl( + LoadBalancerLoadBalancingRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + public LoadBalancingRule get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName) { + LoadBalancingRuleInner inner = + this.serviceClient().get(resourceGroupName, loadBalancerName, loadBalancingRuleName); + if (inner != null) { + return new LoadBalancingRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, loadBalancingRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LoadBalancingRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerLoadBalancingRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.java new file mode 100644 index 0000000000000..bfbc68bf2486a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerNetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerNetworkInterfacesClient. */ +public final class LoadBalancerNetworkInterfacesClientImpl implements LoadBalancerNetworkInterfacesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerNetworkInterfacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerNetworkInterfacesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerNetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerNetworkInterfacesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerNetworkInterfacesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerNetworkInterfaces to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerNetworkInterfacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..ca008886637a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerNetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerNetworkInterfaces; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerNetworkInterfacesImpl implements LoadBalancerNetworkInterfaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerNetworkInterfacesImpl.class); + + private final LoadBalancerNetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerNetworkInterfacesImpl( + LoadBalancerNetworkInterfacesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + private LoadBalancerNetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java new file mode 100644 index 0000000000000..938071775205d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerOutboundRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerOutboundRulesClient. */ +public final class LoadBalancerOutboundRulesClientImpl implements LoadBalancerOutboundRulesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerOutboundRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerOutboundRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerOutboundRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + LoadBalancerOutboundRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerOutboundRules to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerOutboundRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/outboundRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("outboundRuleName") String outboundRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleInner get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + return getAsync(resourceGroupName, loadBalancerName, outboundRuleName).block(); + } + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListOutboundRule API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..61b110d09617a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerOutboundRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRules; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerOutboundRulesImpl implements LoadBalancerOutboundRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRulesImpl.class); + + private final LoadBalancerOutboundRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerOutboundRulesImpl( + LoadBalancerOutboundRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + public OutboundRule get(String resourceGroupName, String loadBalancerName, String outboundRuleName) { + OutboundRuleInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, outboundRuleName); + if (inner != null) { + return new OutboundRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, outboundRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OutboundRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerOutboundRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java new file mode 100644 index 0000000000000..f496abcfb4678 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerProbesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerProbeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoadBalancerProbesClient. */ +public final class LoadBalancerProbesClientImpl implements LoadBalancerProbesClient { + private final ClientLogger logger = new ClientLogger(LoadBalancerProbesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancerProbesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancerProbesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancerProbesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(LoadBalancerProbesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancerProbes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancerProbesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/probes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}/probes/{probeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("probeName") String probeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, loadBalancerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName)); + } + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, loadBalancerName, context)); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProbeInner get(String resourceGroupName, String loadBalancerName, String probeName) { + return getAsync(resourceGroupName, loadBalancerName, probeName).block(); + } + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListProbe API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..3a65b5be97f4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancerProbesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerProbes; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancerProbesImpl implements LoadBalancerProbes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerProbesImpl.class); + + private final LoadBalancerProbesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancerProbesImpl( + LoadBalancerProbesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName); + return Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String loadBalancerName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, loadBalancerName, context); + return Utils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + public Probe get(String resourceGroupName, String loadBalancerName, String probeName) { + ProbeInner inner = this.serviceClient().get(resourceGroupName, loadBalancerName, probeName); + if (inner != null) { + return new ProbeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, loadBalancerName, probeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProbeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LoadBalancerProbesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java new file mode 100644 index 0000000000000..f7c30cad5ddd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java @@ -0,0 +1,2108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.LoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.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 { + private final ClientLogger logger = new ClientLogger(LoadBalancersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoadBalancersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LoadBalancersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoadBalancersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(LoadBalancersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLoadBalancers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LoadBalancersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoadBalancerInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers/{loadBalancerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/setLoadBalancerFrontendPublicIpAddresses") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> swapPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoadBalancerVipSwapRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName) { + return beginDeleteAsync(resourceGroupName, loadBalancerName).getSyncPoller(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String loadBalancerName, Context context) { + return beginDeleteAsync(resourceGroupName, loadBalancerName, context).getSyncPoller(); + } + + /** + * Deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String loadBalancerName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner getByResourceGroup(String resourceGroupName, String loadBalancerName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, loadBalancerName, expand).block(); + } + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + loadBalancerName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the create or update load balancer operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, loadBalancerName, parameters).block(); + } + + /** + * Updates a load balancer tags. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to update load balancer tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return loadBalancer resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the load balancers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters) { + return beginSwapPublicIpAddressesAsync(location, parameters).getSyncPoller(); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSwapPublicIpAddresses( + String location, LoadBalancerVipSwapRequest parameters, Context context) { + return beginSwapPublicIpAddressesAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings( + String groupName, + String loadBalancerName, + String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters) { + return 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 response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings( + String groupName, + String loadBalancerName, + String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters, + Context context) { + return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..9a87ec93fe992 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoadBalancersImpl implements LoadBalancers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancersImpl.class); + + private final LoadBalancersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LoadBalancersImpl( + LoadBalancersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String loadBalancerName) { + this.serviceClient().delete(resourceGroupName, loadBalancerName); + } + + public void delete(String resourceGroupName, String loadBalancerName, Context context) { + this.serviceClient().delete(resourceGroupName, loadBalancerName, context); + } + + public LoadBalancer getByResourceGroup(String resourceGroupName, String loadBalancerName) { + LoadBalancerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, loadBalancerName); + if (inner != null) { + return new LoadBalancerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LoadBalancerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters) { + this.serviceClient().swapPublicIpAddresses(location, parameters); + } + + public void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context) { + this.serviceClient().swapPublicIpAddresses(location, parameters, context); + } + + public 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..027ff5e37856b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class LocalNetworkGatewayImpl + implements LocalNetworkGateway, LocalNetworkGateway.Definition, LocalNetworkGateway.Update { + private LocalNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..3c7ccf57800a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.LocalNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGatewayListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocalNetworkGatewaysClient. */ +public final class LocalNetworkGatewaysClientImpl implements LocalNetworkGatewaysClient { + private final ClientLogger logger = new ClientLogger(LocalNetworkGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocalNetworkGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of LocalNetworkGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocalNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(LocalNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientLocalNetworkGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface LocalNetworkGatewaysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LocalNetworkGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways/{localNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("localNetworkGatewayName") String localNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/localNetworkGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + localNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String localNetworkGatewayName, + LocalNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a local network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the create or update local network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupAsync(resourceGroupName, localNetworkGatewayName).block(); + } + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName, context).block(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String localNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, localNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalNetworkGatewayInner updateTags( + String resourceGroupName, String localNetworkGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, localNetworkGatewayName, parameters).block(); + } + + /** + * Updates a local network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to update local network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLocalNetworkGateways API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..33958fd348e81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.LocalNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocalNetworkGatewaysImpl implements LocalNetworkGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewaysImpl.class); + + private final LocalNetworkGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public LocalNetworkGatewaysImpl( + LocalNetworkGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LocalNetworkGateway getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + LocalNetworkGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, localNetworkGatewayName); + if (inner != null) { + return new LocalNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocalNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + this.serviceClient().delete(resourceGroupName, localNetworkGatewayName); + } + + public void delete(String resourceGroupName, String localNetworkGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, localNetworkGatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public LocalNetworkGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = Utils.getValueFromIdByName(id, "localNetworkGateways"); + if (localNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'localNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, localNetworkGatewayName, context); + } + + private LocalNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public LocalNetworkGatewayImpl define(String name) { + return new LocalNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java new file mode 100644 index 0000000000000..c5211e868b0f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NatGatewayImpl implements NatGateway, NatGateway.Definition, NatGateway.Update { + private NatGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NatGatewaySku sku() { + return this.innerModel().sku(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..6af1b87b07310 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java @@ -0,0 +1,1479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGatewayListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NatGatewaysClient. */ +public final class NatGatewaysClientImpl implements NatGatewaysClient { + private final ClientLogger logger = new ClientLogger(NatGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NatGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NatGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NatGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NatGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNatGateways to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NatGatewaysService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NatGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways" + + "/{natGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("natGatewayName") String natGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/natGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String natGatewayName) { + return beginDeleteAsync(resourceGroupName, natGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String natGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, natGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String natGatewayName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner getByResourceGroup(String resourceGroupName, String natGatewayName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, natGatewayName, expand).block(); + } + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + natGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String natGatewayName, NatGatewayInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, natGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to the create or update nat gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, natGatewayName, parameters).block(); + } + + /** + * Updates nat gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param parameters Parameters supplied to update nat gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nat Gateway resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..fedd6cbe0e9ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.NatGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NatGatewaysImpl implements NatGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewaysImpl.class); + + private final NatGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NatGatewaysImpl( + NatGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String natGatewayName) { + this.serviceClient().delete(resourceGroupName, natGatewayName); + } + + public void delete(String resourceGroupName, String natGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, natGatewayName, context); + } + + public NatGateway getByResourceGroup(String resourceGroupName, String natGatewayName) { + NatGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, natGatewayName); + if (inner != null) { + return new NatGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NatGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public NatGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, natGatewayName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = Utils.getValueFromIdByName(id, "natGateways"); + if (natGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natGateways'.", id))); + } + this.delete(resourceGroupName, natGatewayName, context); + } + + private NatGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NatGatewayImpl define(String name) { + return new NatGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java new file mode 100644 index 0000000000000..6fc4d38c031b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ListVpnGatewayNatRulesResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NatRulesClient. */ +public final class NatRulesClientImpl implements NatRulesClient { + private final ClientLogger logger = new ClientLogger(NatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NatRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNatRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnGatewayNatRuleInner natRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/natRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayNatRuleInner get(String resourceGroupName, String gatewayName, String natRuleName) { + return getAsync(resourceGroupName, gatewayName, natRuleName).block(); + } + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters).getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String natRuleName, + VpnGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, natRuleName, natRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, natRuleName, context).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync( + String resourceGroupName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName, context), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName)); + } + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..a6bd50d3917b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.NatRules; +import com.azure.resourcemanager.network.generated.models.VpnGatewayNatRule; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NatRulesImpl implements NatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatRulesImpl.class); + + private final NatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NatRulesImpl( + NatRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnGatewayNatRule get(String resourceGroupName, String gatewayName, String natRuleName) { + VpnGatewayNatRuleInner inner = this.serviceClient().get(resourceGroupName, gatewayName, natRuleName); + if (inner != null) { + return new VpnGatewayNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, gatewayName, natRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnGatewayNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String gatewayName, String natRuleName) { + this.serviceClient().delete(resourceGroupName, gatewayName, natRuleName); + } + + public void delete(String resourceGroupName, String gatewayName, String natRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, natRuleName, context); + } + + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName); + return Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public VpnGatewayNatRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, gatewayName, natRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, gatewayName, natRuleName, context); + } + + private NatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayNatRuleImpl define(String name) { + return new VpnGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java new file mode 100644 index 0000000000000..b82442ab8e941 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkConfigurationDiagnosticResponseImpl implements NetworkConfigurationDiagnosticResponse { + private NetworkConfigurationDiagnosticResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkConfigurationDiagnosticResponseImpl( + NetworkConfigurationDiagnosticResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkConfigurationDiagnosticResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java new file mode 100644 index 0000000000000..618dd85807e97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceDnsSettings; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceMigrationPhase; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceNicType; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class NetworkInterfaceImpl + implements NetworkInterface, NetworkInterface.Definition, NetworkInterface.Update { + private NetworkInterfaceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkInterfaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkInterfaceName; + + private TagsObject updateParameters; + + public NetworkInterfaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkInterface create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterface create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .createOrUpdate(resourceGroupName, networkInterfaceName, this.innerModel(), context); + return this; + } + + NetworkInterfaceImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkInterfaceInner(); + this.serviceManager = serviceManager; + this.networkInterfaceName = name; + } + + public NetworkInterfaceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkInterface apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .updateTagsWithResponse(resourceGroupName, networkInterfaceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .updateTagsWithResponse(resourceGroupName, networkInterfaceName, updateParameters, context) + .getValue(); + return this; + } + + NetworkInterfaceImpl( + NetworkInterfaceInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + } + + public NetworkInterface refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterface refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, context) + .getValue(); + return this; + } + + public EffectiveRouteListResult getEffectiveRouteTable() { + return serviceManager.networkInterfaces().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + } + + public EffectiveRouteListResult getEffectiveRouteTable(Context context) { + return serviceManager + .networkInterfaces() + .getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups() { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(Context context) { + return serviceManager + .networkInterfaces() + .listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + } + + public NetworkInterfaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkInterfaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkInterfaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkInterfaceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public NetworkInterfaceImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public NetworkInterfaceImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public NetworkInterfaceImpl withDnsSettings(NetworkInterfaceDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public NetworkInterfaceImpl withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.innerModel().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + public NetworkInterfaceImpl withEnableIpForwarding(Boolean enableIpForwarding) { + this.innerModel().withEnableIpForwarding(enableIpForwarding); + return this; + } + + public NetworkInterfaceImpl withWorkloadType(String workloadType) { + this.innerModel().withWorkloadType(workloadType); + return this; + } + + public NetworkInterfaceImpl withNicType(NetworkInterfaceNicType nicType) { + this.innerModel().withNicType(nicType); + return this; + } + + public NetworkInterfaceImpl withPrivateLinkService(PrivateLinkServiceInner privateLinkService) { + this.innerModel().withPrivateLinkService(privateLinkService); + return this; + } + + public NetworkInterfaceImpl withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase) { + this.innerModel().withMigrationPhase(migrationPhase); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java new file mode 100644 index 0000000000000..8c5e4fb7af7a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.InboundNatRule; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkInterfaceIpConfigurationImpl implements NetworkInterfaceIpConfiguration { + private NetworkInterfaceIpConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfaceIpConfigurationImpl( + NetworkInterfaceIpConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource gatewayLoadBalancer() { + return this.innerModel().gatewayLoadBalancer(); + } + + public List virtualNetworkTaps() { + List inner = this.innerModel().virtualNetworkTaps(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List applicationGatewayBackendAddressPools() { + List inner = this.innerModel().applicationGatewayBackendAddressPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerBackendAddressPools() { + List inner = this.innerModel().loadBalancerBackendAddressPools(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new BackendAddressPoolImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List loadBalancerInboundNatRules() { + List inner = this.innerModel().loadBalancerInboundNatRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new InboundNatRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String privateIpAddress() { + return this.innerModel().privateIpAddress(); + } + + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerModel().privateIpAllocationMethod(); + } + + public IpVersion privateIpAddressVersion() { + return this.innerModel().privateIpAddressVersion(); + } + + public Subnet subnet() { + SubnetInner inner = this.innerModel().subnet(); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean primary() { + return this.innerModel().primary(); + } + + public PublicIpAddress publicIpAddress() { + PublicIpAddressInner inner = this.innerModel().publicIpAddress(); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public List applicationSecurityGroups() { + List inner = this.innerModel().applicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties() { + return this.innerModel().privateLinkConnectionProperties(); + } + + public NetworkInterfaceIpConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..369f14ac11b43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceIpConfigurationsClient. + */ +public final class NetworkInterfaceIpConfigurationsClientImpl implements NetworkInterfaceIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceIpConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceIpConfigurations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceIpConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + return getAsync(resourceGroupName, networkInterfaceName, ipConfigurationName).block(); + } + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..90659d71642b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceIpConfigurationsImpl implements NetworkInterfaceIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationsImpl.class); + + private final NetworkInterfaceIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceIpConfigurationsImpl( + NetworkInterfaceIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceIpConfiguration get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName) { + NetworkInterfaceIpConfigurationInner inner = + this.serviceClient().get(resourceGroupName, networkInterfaceName, ipConfigurationName); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkInterfaceName, ipConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NetworkInterfaceIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.java new file mode 100644 index 0000000000000..43fd427a0b973 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancerListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkInterfaceLoadBalancersClient. */ +public final class NetworkInterfaceLoadBalancersClientImpl implements NetworkInterfaceLoadBalancersClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceLoadBalancersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceLoadBalancersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceLoadBalancersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceLoadBalancersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceLoadBalancers to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceLoadBalancersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/loadBalancers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..99a52c74310b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceLoadBalancers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceLoadBalancersImpl implements NetworkInterfaceLoadBalancers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancersImpl.class); + + private final NetworkInterfaceLoadBalancersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceLoadBalancersImpl( + NetworkInterfaceLoadBalancersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + private NetworkInterfaceLoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..4e70188d27cb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacePropertiesFormatImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.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.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 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 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..9d8b2ffe2825c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; + +public final class NetworkInterfaceTapConfigurationImpl + implements NetworkInterfaceTapConfiguration, + NetworkInterfaceTapConfiguration.Definition, + NetworkInterfaceTapConfiguration.Update { + private NetworkInterfaceTapConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public VirtualNetworkTap virtualNetworkTap() { + VirtualNetworkTapInner inner = this.innerModel().virtualNetworkTap(); + if (inner != null) { + return new VirtualNetworkTapImpl(inner, this.manager()); + } else { + return null; + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetworkInterfaceTapConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkInterfaceName; + + private String tapConfigurationName; + + public NetworkInterfaceTapConfigurationImpl withExistingNetworkInterface( + String resourceGroupName, String networkInterfaceName) { + this.resourceGroupName = resourceGroupName; + this.networkInterfaceName = networkInterfaceName; + return this; + } + + public NetworkInterfaceTapConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterfaceTapConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), context); + return this; + } + + NetworkInterfaceTapConfigurationImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkInterfaceTapConfigurationInner(); + this.serviceManager = serviceManager; + this.tapConfigurationName = name; + } + + public NetworkInterfaceTapConfigurationImpl update() { + return this; + } + + public NetworkInterfaceTapConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkInterfaceTapConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .createOrUpdate( + resourceGroupName, networkInterfaceName, tapConfigurationName, this.innerModel(), context); + return this; + } + + NetworkInterfaceTapConfigurationImpl( + NetworkInterfaceTapConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = Utils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + this.tapConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "tapConfigurations"); + } + + public NetworkInterfaceTapConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkInterfaceTapConfigurations() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context) + .getValue(); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public NetworkInterfaceTapConfigurationImpl withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap) { + this.innerModel().withVirtualNetworkTap(virtualNetworkTap); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..4a21bab1e00c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java @@ -0,0 +1,1202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurationListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkInterfaceTapConfigurationsClient. + */ +public final class NetworkInterfaceTapConfigurationsClientImpl implements NetworkInterfaceTapConfigurationsClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfaceTapConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfaceTapConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfaceTapConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + NetworkInterfaceTapConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaceTapConfigurations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfaceTapConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("tapConfigurationName") String tapConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/tapConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).getSyncPoller(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, tapConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceTapConfigurationInner get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + return getAsync(resourceGroupName, networkInterfaceName, tapConfigurationName).block(); + } + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + tapConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + tapConfigurationParameters, + accept, + context); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String networkInterfaceName, + String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Tap configuration in the specified NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param tapConfigurationParameters Parameters supplied to the create or update tap configuration operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tap configuration in a Network Interface 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkInterfaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName)); + } + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkInterfaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list tap configurations API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..18327ead1d1a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfaceTapConfigurationsImpl implements NetworkInterfaceTapConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationsImpl.class); + + private final NetworkInterfaceTapConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfaceTapConfigurationsImpl( + NetworkInterfaceTapConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, tapConfigurationName); + } + + public void delete( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + public NetworkInterfaceTapConfiguration get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName) { + NetworkInterfaceTapConfigurationInner inner = + this.serviceClient().get(resourceGroupName, networkInterfaceName, tapConfigurationName); + if (inner != null) { + return new NetworkInterfaceTapConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceTapConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkInterfaceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceTapConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String tapConfigurationName = Utils.getValueFromIdByName(id, "tapConfigurations"); + if (tapConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'tapConfigurations'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, tapConfigurationName, context); + } + + private NetworkInterfaceTapConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceTapConfigurationImpl define(String name) { + return new NetworkInterfaceTapConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java new file mode 100644 index 0000000000000..c01e815e7fa67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java @@ -0,0 +1,4567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationListResult; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkInterfacesClient. */ +public final class NetworkInterfacesClientImpl implements NetworkInterfacesClient { + private final ClientLogger logger = new ClientLogger(NetworkInterfacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkInterfacesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkInterfacesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkInterfacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkInterfaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkInterfacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstanceNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCloudServiceNetworkInterface( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkInterfaceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/effectiveRouteTable") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getEffectiveRouteTable( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listEffectiveNetworkSecurityGroups( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetNetworkInterfaces( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetNetworkInterface( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetIpConfigurations( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetIpConfiguration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstanceNetworkInterfacesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceNetworkInterfacesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMNetworkInterfacesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetNetworkInterfacesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetIpConfigurationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceRoleInstanceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstanceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName), + nextLink -> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstanceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstanceNetworkInterfacesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName, context), + nextLink -> listCloudServiceRoleInstanceNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + return new PagedIterable<>( + listCloudServiceRoleInstanceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, roleInstanceName)); + } + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + return new PagedIterable<>( + listCloudServiceRoleInstanceNetworkInterfacesAsync( + resourceGroupName, cloudServiceName, roleInstanceName, context)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceNetworkInterfaces( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listCloudServiceNetworkInterfacesSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listCloudServiceNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceNetworkInterfacesAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listCloudServiceNetworkInterfacesSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listCloudServiceNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>( + listCloudServiceNetworkInterfacesAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCloudServiceNetworkInterface( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCloudServiceNetworkInterfaceAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand) { + return getCloudServiceNetworkInterfaceWithResponseAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName) { + final String expand = null; + return getCloudServiceNetworkInterfaceAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) + .block(); + } + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkInterfaceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); + } + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkInterfaceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkInterfaceName, expand).block(); + } + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create or update network interface operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner updateTags( + String resourceGroupName, String networkInterfaceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkInterfaceName, parameters).block(); + } + + /** + * Updates a network interface tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to update network interface tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a network interface in a resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network interfaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEffectiveRouteTable( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName, Context context) { + return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName, context).getSyncPoller(); + } + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEffectiveNetworkSecurityGroups( + this.client.getEndpoint(), + resourceGroupName, + networkInterfaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).getSyncPoller(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName, context) + .getSyncPoller(); + } + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex), + nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context), + nextLink -> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMNetworkInterfacesAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)); + } + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMNetworkInterfacesAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName), + nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetNetworkInterfacesAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, context), + nextLink -> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedIterable<>( + listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName)); + } + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetNetworkInterfacesAsync(resourceGroupName, virtualMachineScaleSetName, context)); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set 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. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetNetworkInterfaceAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithResponseAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return getVirtualMachineScaleSetNetworkInterfaceAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) + .block(); + } + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set 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 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetIpConfigurationsAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetIpConfigurationsSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context), + nextLink -> listVirtualMachineScaleSetIpConfigurationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + final String expand = null; + return new PagedIterable<>( + listVirtualMachineScaleSetIpConfigurationsAsync( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetIpConfigurationsAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context)); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set 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. + * @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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineScaleSetIpConfigurationAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand) { + return getVirtualMachineScaleSetIpConfigurationWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkInterfaceIpConfigurationInner getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + final String expand = null; + return getVirtualMachineScaleSetIpConfigurationAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand) + .block(); + } + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set 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 next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..60fd2c4c6ea5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.java @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteListResult; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaces; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkInterfacesImpl implements NetworkInterfaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfacesImpl.class); + + private final NetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkInterfacesImpl( + NetworkInterfacesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstanceNetworkInterfaces(resourceGroupName, cloudServiceName, roleInstanceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstanceNetworkInterfaces( + resourceGroupName, cloudServiceName, roleInstanceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public NetworkInterface getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName) { + NetworkInterfaceInner inner = + this + .serviceClient() + .getCloudServiceNetworkInterface( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getCloudServiceNetworkInterfaceWithResponse( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkInterfaceName) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName); + } + + public void delete(String resourceGroupName, String networkInterfaceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkInterfaceName, context); + } + + public NetworkInterface getByResourceGroup(String resourceGroupName, String networkInterfaceName) { + NetworkInterfaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public EffectiveRouteListResult getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteListResult getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveRouteListResultInner inner = + this.serviceClient().getEffectiveRouteTable(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context) { + EffectiveNetworkSecurityGroupListResultInner inner = + this.serviceClient().listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, context); + if (inner != null) { + return new EffectiveNetworkSecurityGroupListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMNetworkInterfaces( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public NetworkInterface getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + NetworkInterfaceInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetNetworkInterface( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName); + if (inner != null) { + return new NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetNetworkInterfaceWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetIpConfigurations( + resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetIpConfigurations( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + expand, + context); + return Utils.mapPage(inner, inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceIpConfiguration getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + NetworkInterfaceIpConfigurationInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetIpConfiguration( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName); + if (inner != null) { + return new NetworkInterfaceIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetIpConfigurationWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkInterfaceIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkInterface getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = Utils.getValueFromIdByName(id, "networkInterfaces"); + if (networkInterfaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkInterfaces'.", id))); + } + this.delete(resourceGroupName, networkInterfaceName, context); + } + + private NetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkInterfaceImpl define(String name) { + return new NetworkInterfaceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java new file mode 100644 index 0000000000000..9acc93ddc894e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the NetworkManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {NetworkManagementClientImpl.class}) +public final class NetworkManagementClientBuilder { + /* + * The subscription credentials which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the NetworkManagementClientBuilder. + */ + public NetworkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NetworkManagementClientImpl with the provided parameters. + * + * @return an instance of NetworkManagementClientImpl. + */ + public NetworkManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + NetworkManagementClientImpl client = + new NetworkManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java new file mode 100644 index 0000000000000..45211aec84fb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,1857 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableEndpointServicesClient; +import com.azure.resourcemanager.network.generated.fluent.AvailablePrivateEndpointTypesClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableResourceGroupDelegationsClient; +import com.azure.resourcemanager.network.generated.fluent.AvailableServiceAliasesClient; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallFqdnTagsClient; +import com.azure.resourcemanager.network.generated.fluent.AzureFirewallsClient; +import com.azure.resourcemanager.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.BgpServiceCommunitiesClient; +import com.azure.resourcemanager.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.CustomIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.DdosCustomPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.DdosProtectionPlansClient; +import com.azure.resourcemanager.network.generated.fluent.DefaultSecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.DscpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCircuitsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteCrossConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.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.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceLoadBalancersClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfaceTapConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkInterfacesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.RoutingIntentsClient; +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.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.WebCategoriesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the NetworkManagementClientImpl type. */ +@ServiceClient(builder = NetworkManagementClientBuilder.class) +public final class NetworkManagementClientImpl implements NetworkManagementClient { + private final ClientLogger logger = new ClientLogger(NetworkManagementClientImpl.class); + + /** + * The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID + * forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ApplicationGatewaysClient object to access its operations. */ + private final ApplicationGatewaysClient applicationGateways; + + /** + * Gets the ApplicationGatewaysClient object to access its operations. + * + * @return the ApplicationGatewaysClient object. + */ + public ApplicationGatewaysClient getApplicationGateways() { + return this.applicationGateways; + } + + /** The ApplicationGatewayPrivateLinkResourcesClient object to access its operations. */ + private final ApplicationGatewayPrivateLinkResourcesClient applicationGatewayPrivateLinkResources; + + /** + * Gets the ApplicationGatewayPrivateLinkResourcesClient object to access its operations. + * + * @return the ApplicationGatewayPrivateLinkResourcesClient object. + */ + public ApplicationGatewayPrivateLinkResourcesClient getApplicationGatewayPrivateLinkResources() { + return this.applicationGatewayPrivateLinkResources; + } + + /** The ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. */ + private final ApplicationGatewayPrivateEndpointConnectionsClient applicationGatewayPrivateEndpointConnections; + + /** + * Gets the ApplicationGatewayPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ApplicationGatewayPrivateEndpointConnectionsClient object. + */ + public ApplicationGatewayPrivateEndpointConnectionsClient getApplicationGatewayPrivateEndpointConnections() { + return this.applicationGatewayPrivateEndpointConnections; + } + + /** The ApplicationSecurityGroupsClient object to access its operations. */ + private final ApplicationSecurityGroupsClient applicationSecurityGroups; + + /** + * Gets the ApplicationSecurityGroupsClient object to access its operations. + * + * @return the ApplicationSecurityGroupsClient object. + */ + public ApplicationSecurityGroupsClient getApplicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** The AvailableDelegationsClient object to access its operations. */ + private final AvailableDelegationsClient availableDelegations; + + /** + * Gets the AvailableDelegationsClient object to access its operations. + * + * @return the AvailableDelegationsClient object. + */ + public AvailableDelegationsClient getAvailableDelegations() { + return this.availableDelegations; + } + + /** The AvailableResourceGroupDelegationsClient object to access its operations. */ + private final AvailableResourceGroupDelegationsClient availableResourceGroupDelegations; + + /** + * Gets the AvailableResourceGroupDelegationsClient object to access its operations. + * + * @return the AvailableResourceGroupDelegationsClient object. + */ + public AvailableResourceGroupDelegationsClient getAvailableResourceGroupDelegations() { + return this.availableResourceGroupDelegations; + } + + /** The AvailableServiceAliasesClient object to access its operations. */ + private final AvailableServiceAliasesClient availableServiceAliases; + + /** + * Gets the AvailableServiceAliasesClient object to access its operations. + * + * @return the AvailableServiceAliasesClient object. + */ + public AvailableServiceAliasesClient getAvailableServiceAliases() { + return this.availableServiceAliases; + } + + /** The AzureFirewallsClient object to access its operations. */ + private final AzureFirewallsClient azureFirewalls; + + /** + * Gets the AzureFirewallsClient object to access its operations. + * + * @return the AzureFirewallsClient object. + */ + public AzureFirewallsClient getAzureFirewalls() { + return this.azureFirewalls; + } + + /** The AzureFirewallFqdnTagsClient object to access its operations. */ + private final AzureFirewallFqdnTagsClient azureFirewallFqdnTags; + + /** + * Gets the AzureFirewallFqdnTagsClient object to access its operations. + * + * @return the AzureFirewallFqdnTagsClient object. + */ + public AzureFirewallFqdnTagsClient getAzureFirewallFqdnTags() { + return this.azureFirewallFqdnTags; + } + + /** The WebCategoriesClient object to access its operations. */ + private final WebCategoriesClient webCategories; + + /** + * Gets the WebCategoriesClient object to access its operations. + * + * @return the WebCategoriesClient object. + */ + public WebCategoriesClient getWebCategories() { + return this.webCategories; + } + + /** The BastionHostsClient object to access its operations. */ + private final BastionHostsClient bastionHosts; + + /** + * Gets the BastionHostsClient object to access its operations. + * + * @return the BastionHostsClient object. + */ + public BastionHostsClient getBastionHosts() { + return this.bastionHosts; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The NetworkInterfacesClient object to access its operations. */ + private final NetworkInterfacesClient networkInterfaces; + + /** + * Gets the NetworkInterfacesClient object to access its operations. + * + * @return the NetworkInterfacesClient object. + */ + public NetworkInterfacesClient getNetworkInterfaces() { + return this.networkInterfaces; + } + + /** The PublicIpAddressesClient object to access its operations. */ + private final PublicIpAddressesClient publicIpAddresses; + + /** + * Gets the PublicIpAddressesClient object to access its operations. + * + * @return the PublicIpAddressesClient object. + */ + public PublicIpAddressesClient getPublicIpAddresses() { + return this.publicIpAddresses; + } + + /** The CustomIpPrefixesClient object to access its operations. */ + private final CustomIpPrefixesClient customIpPrefixes; + + /** + * Gets the CustomIpPrefixesClient object to access its operations. + * + * @return the CustomIpPrefixesClient object. + */ + public CustomIpPrefixesClient getCustomIpPrefixes() { + return this.customIpPrefixes; + } + + /** The DdosCustomPoliciesClient object to access its operations. */ + private final DdosCustomPoliciesClient ddosCustomPolicies; + + /** + * Gets the DdosCustomPoliciesClient object to access its operations. + * + * @return the DdosCustomPoliciesClient object. + */ + public DdosCustomPoliciesClient getDdosCustomPolicies() { + return this.ddosCustomPolicies; + } + + /** The DdosProtectionPlansClient object to access its operations. */ + private final DdosProtectionPlansClient ddosProtectionPlans; + + /** + * Gets the DdosProtectionPlansClient object to access its operations. + * + * @return the DdosProtectionPlansClient object. + */ + public DdosProtectionPlansClient getDdosProtectionPlans() { + return this.ddosProtectionPlans; + } + + /** The DscpConfigurationsClient object to access its operations. */ + private final DscpConfigurationsClient dscpConfigurations; + + /** + * Gets the DscpConfigurationsClient object to access its operations. + * + * @return the DscpConfigurationsClient object. + */ + public DscpConfigurationsClient getDscpConfigurations() { + return this.dscpConfigurations; + } + + /** The AvailableEndpointServicesClient object to access its operations. */ + private final AvailableEndpointServicesClient availableEndpointServices; + + /** + * Gets the AvailableEndpointServicesClient object to access its operations. + * + * @return the AvailableEndpointServicesClient object. + */ + public AvailableEndpointServicesClient getAvailableEndpointServices() { + return this.availableEndpointServices; + } + + /** The ExpressRouteCircuitAuthorizationsClient object to access its operations. */ + private final ExpressRouteCircuitAuthorizationsClient expressRouteCircuitAuthorizations; + + /** + * Gets the ExpressRouteCircuitAuthorizationsClient object to access its operations. + * + * @return the ExpressRouteCircuitAuthorizationsClient object. + */ + public ExpressRouteCircuitAuthorizationsClient getExpressRouteCircuitAuthorizations() { + return this.expressRouteCircuitAuthorizations; + } + + /** The ExpressRouteCircuitPeeringsClient object to access its operations. */ + private final ExpressRouteCircuitPeeringsClient expressRouteCircuitPeerings; + + /** + * Gets the ExpressRouteCircuitPeeringsClient object to access its operations. + * + * @return the ExpressRouteCircuitPeeringsClient object. + */ + public ExpressRouteCircuitPeeringsClient getExpressRouteCircuitPeerings() { + return this.expressRouteCircuitPeerings; + } + + /** The ExpressRouteCircuitConnectionsClient object to access its operations. */ + private final ExpressRouteCircuitConnectionsClient expressRouteCircuitConnections; + + /** + * Gets the ExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the ExpressRouteCircuitConnectionsClient object. + */ + public ExpressRouteCircuitConnectionsClient getExpressRouteCircuitConnections() { + return this.expressRouteCircuitConnections; + } + + /** The PeerExpressRouteCircuitConnectionsClient object to access its operations. */ + private final PeerExpressRouteCircuitConnectionsClient peerExpressRouteCircuitConnections; + + /** + * Gets the PeerExpressRouteCircuitConnectionsClient object to access its operations. + * + * @return the PeerExpressRouteCircuitConnectionsClient object. + */ + public PeerExpressRouteCircuitConnectionsClient getPeerExpressRouteCircuitConnections() { + return this.peerExpressRouteCircuitConnections; + } + + /** The ExpressRouteCircuitsClient object to access its operations. */ + private final ExpressRouteCircuitsClient expressRouteCircuits; + + /** + * Gets the ExpressRouteCircuitsClient object to access its operations. + * + * @return the ExpressRouteCircuitsClient object. + */ + public ExpressRouteCircuitsClient getExpressRouteCircuits() { + return this.expressRouteCircuits; + } + + /** The ExpressRouteServiceProvidersClient object to access its operations. */ + private final ExpressRouteServiceProvidersClient expressRouteServiceProviders; + + /** + * Gets the ExpressRouteServiceProvidersClient object to access its operations. + * + * @return the ExpressRouteServiceProvidersClient object. + */ + public ExpressRouteServiceProvidersClient getExpressRouteServiceProviders() { + return this.expressRouteServiceProviders; + } + + /** The ExpressRouteCrossConnectionsClient object to access its operations. */ + private final ExpressRouteCrossConnectionsClient expressRouteCrossConnections; + + /** + * Gets the ExpressRouteCrossConnectionsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionsClient object. + */ + public ExpressRouteCrossConnectionsClient getExpressRouteCrossConnections() { + return this.expressRouteCrossConnections; + } + + /** The ExpressRouteCrossConnectionPeeringsClient object to access its operations. */ + private final ExpressRouteCrossConnectionPeeringsClient expressRouteCrossConnectionPeerings; + + /** + * Gets the ExpressRouteCrossConnectionPeeringsClient object to access its operations. + * + * @return the ExpressRouteCrossConnectionPeeringsClient object. + */ + public ExpressRouteCrossConnectionPeeringsClient getExpressRouteCrossConnectionPeerings() { + return this.expressRouteCrossConnectionPeerings; + } + + /** The ExpressRoutePortsLocationsClient object to access its operations. */ + private final ExpressRoutePortsLocationsClient expressRoutePortsLocations; + + /** + * Gets the ExpressRoutePortsLocationsClient object to access its operations. + * + * @return the ExpressRoutePortsLocationsClient object. + */ + public ExpressRoutePortsLocationsClient getExpressRoutePortsLocations() { + return this.expressRoutePortsLocations; + } + + /** The ExpressRoutePortsClient object to access its operations. */ + private final ExpressRoutePortsClient expressRoutePorts; + + /** + * Gets the ExpressRoutePortsClient object to access its operations. + * + * @return the ExpressRoutePortsClient object. + */ + public ExpressRoutePortsClient getExpressRoutePorts() { + return this.expressRoutePorts; + } + + /** The ExpressRouteLinksClient object to access its operations. */ + private final ExpressRouteLinksClient expressRouteLinks; + + /** + * Gets the ExpressRouteLinksClient object to access its operations. + * + * @return the ExpressRouteLinksClient object. + */ + public ExpressRouteLinksClient getExpressRouteLinks() { + return this.expressRouteLinks; + } + + /** The 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 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 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 VirtualHubsClient object to access its operations. */ + private final VirtualHubsClient virtualHubs; + + /** + * Gets the VirtualHubsClient object to access its operations. + * + * @return the VirtualHubsClient object. + */ + public VirtualHubsClient getVirtualHubs() { + return this.virtualHubs; + } + + /** The HubVirtualNetworkConnectionsClient object to access its operations. */ + private final HubVirtualNetworkConnectionsClient hubVirtualNetworkConnections; + + /** + * Gets the HubVirtualNetworkConnectionsClient object to access its operations. + * + * @return the HubVirtualNetworkConnectionsClient object. + */ + public HubVirtualNetworkConnectionsClient getHubVirtualNetworkConnections() { + return this.hubVirtualNetworkConnections; + } + + /** The VpnGatewaysClient object to access its operations. */ + private final VpnGatewaysClient vpnGateways; + + /** + * Gets the VpnGatewaysClient object to access its operations. + * + * @return the VpnGatewaysClient object. + */ + public VpnGatewaysClient getVpnGateways() { + return this.vpnGateways; + } + + /** The VpnLinkConnectionsClient object to access its operations. */ + private final VpnLinkConnectionsClient vpnLinkConnections; + + /** + * Gets the VpnLinkConnectionsClient object to access its operations. + * + * @return the VpnLinkConnectionsClient object. + */ + public VpnLinkConnectionsClient getVpnLinkConnections() { + return this.vpnLinkConnections; + } + + /** The VpnConnectionsClient object to access its operations. */ + private final VpnConnectionsClient vpnConnections; + + /** + * Gets the VpnConnectionsClient object to access its operations. + * + * @return the VpnConnectionsClient object. + */ + public VpnConnectionsClient getVpnConnections() { + return this.vpnConnections; + } + + /** The VpnSiteLinkConnectionsClient object to access its operations. */ + private final VpnSiteLinkConnectionsClient vpnSiteLinkConnections; + + /** + * Gets the VpnSiteLinkConnectionsClient object to access its operations. + * + * @return the VpnSiteLinkConnectionsClient object. + */ + public VpnSiteLinkConnectionsClient getVpnSiteLinkConnections() { + return this.vpnSiteLinkConnections; + } + + /** The NatRulesClient object to access its operations. */ + private final NatRulesClient natRules; + + /** + * Gets the NatRulesClient object to access its operations. + * + * @return the NatRulesClient object. + */ + public NatRulesClient getNatRules() { + return this.natRules; + } + + /** The P2SVpnGatewaysClient object to access its operations. */ + private final P2SVpnGatewaysClient p2SVpnGateways; + + /** + * Gets the P2SVpnGatewaysClient object to access its operations. + * + * @return the P2SVpnGatewaysClient object. + */ + public P2SVpnGatewaysClient getP2SVpnGateways() { + return this.p2SVpnGateways; + } + + /** The VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. */ + private final VpnServerConfigurationsAssociatedWithVirtualWansClient + vpnServerConfigurationsAssociatedWithVirtualWans; + + /** + * Gets the VpnServerConfigurationsAssociatedWithVirtualWansClient object to access its operations. + * + * @return the VpnServerConfigurationsAssociatedWithVirtualWansClient object. + */ + public VpnServerConfigurationsAssociatedWithVirtualWansClient + getVpnServerConfigurationsAssociatedWithVirtualWans() { + return this.vpnServerConfigurationsAssociatedWithVirtualWans; + } + + /** The VirtualHubRouteTableV2SClient object to access its operations. */ + private final VirtualHubRouteTableV2SClient virtualHubRouteTableV2S; + + /** + * Gets the VirtualHubRouteTableV2SClient object to access its operations. + * + * @return the VirtualHubRouteTableV2SClient object. + */ + public VirtualHubRouteTableV2SClient getVirtualHubRouteTableV2S() { + return this.virtualHubRouteTableV2S; + } + + /** The ExpressRouteGatewaysClient object to access its operations. */ + private final ExpressRouteGatewaysClient expressRouteGateways; + + /** + * Gets the ExpressRouteGatewaysClient object to access its operations. + * + * @return the ExpressRouteGatewaysClient object. + */ + public ExpressRouteGatewaysClient getExpressRouteGateways() { + return this.expressRouteGateways; + } + + /** The ExpressRouteConnectionsClient object to access its operations. */ + private final ExpressRouteConnectionsClient expressRouteConnections; + + /** + * Gets the ExpressRouteConnectionsClient object to access its operations. + * + * @return the ExpressRouteConnectionsClient object. + */ + public ExpressRouteConnectionsClient getExpressRouteConnections() { + return this.expressRouteConnections; + } + + /** The VirtualHubBgpConnectionsClient object to access its operations. */ + private final VirtualHubBgpConnectionsClient virtualHubBgpConnections; + + /** + * Gets the VirtualHubBgpConnectionsClient object to access its operations. + * + * @return the VirtualHubBgpConnectionsClient object. + */ + public VirtualHubBgpConnectionsClient getVirtualHubBgpConnections() { + return this.virtualHubBgpConnections; + } + + /** The VirtualHubIpConfigurationsClient object to access its operations. */ + private final VirtualHubIpConfigurationsClient virtualHubIpConfigurations; + + /** + * Gets the VirtualHubIpConfigurationsClient object to access its operations. + * + * @return the VirtualHubIpConfigurationsClient object. + */ + public VirtualHubIpConfigurationsClient getVirtualHubIpConfigurations() { + return this.virtualHubIpConfigurations; + } + + /** The HubRouteTablesClient object to access its operations. */ + private final HubRouteTablesClient hubRouteTables; + + /** + * Gets the HubRouteTablesClient object to access its operations. + * + * @return the HubRouteTablesClient object. + */ + public HubRouteTablesClient getHubRouteTables() { + return this.hubRouteTables; + } + + /** The 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.applicationSecurityGroups = new ApplicationSecurityGroupsClientImpl(this); + this.availableDelegations = new AvailableDelegationsClientImpl(this); + this.availableResourceGroupDelegations = new AvailableResourceGroupDelegationsClientImpl(this); + this.availableServiceAliases = new AvailableServiceAliasesClientImpl(this); + this.azureFirewalls = new AzureFirewallsClientImpl(this); + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsClientImpl(this); + this.webCategories = new WebCategoriesClientImpl(this); + this.bastionHosts = new BastionHostsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.networkInterfaces = new NetworkInterfacesClientImpl(this); + this.publicIpAddresses = new PublicIpAddressesClientImpl(this); + this.customIpPrefixes = new CustomIpPrefixesClientImpl(this); + this.ddosCustomPolicies = new DdosCustomPoliciesClientImpl(this); + this.ddosProtectionPlans = new DdosProtectionPlansClientImpl(this); + this.dscpConfigurations = new DscpConfigurationsClientImpl(this); + this.availableEndpointServices = new AvailableEndpointServicesClientImpl(this); + this.expressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsClientImpl(this); + this.expressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsClientImpl(this); + this.expressRouteCircuitConnections = new ExpressRouteCircuitConnectionsClientImpl(this); + this.peerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsClientImpl(this); + this.expressRouteCircuits = new ExpressRouteCircuitsClientImpl(this); + this.expressRouteServiceProviders = new ExpressRouteServiceProvidersClientImpl(this); + this.expressRouteCrossConnections = new ExpressRouteCrossConnectionsClientImpl(this); + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsClientImpl(this); + this.expressRoutePortsLocations = new ExpressRoutePortsLocationsClientImpl(this); + this.expressRoutePorts = new ExpressRoutePortsClientImpl(this); + this.expressRouteLinks = new ExpressRouteLinksClientImpl(this); + this.expressRoutePortAuthorizations = new ExpressRoutePortAuthorizationsClientImpl(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.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.virtualHubs = new VirtualHubsClientImpl(this); + this.hubVirtualNetworkConnections = new HubVirtualNetworkConnectionsClientImpl(this); + this.vpnGateways = new VpnGatewaysClientImpl(this); + this.vpnLinkConnections = new VpnLinkConnectionsClientImpl(this); + this.vpnConnections = new VpnConnectionsClientImpl(this); + this.vpnSiteLinkConnections = new VpnSiteLinkConnectionsClientImpl(this); + this.natRules = new NatRulesClientImpl(this); + this.p2SVpnGateways = new P2SVpnGatewaysClientImpl(this); + this.vpnServerConfigurationsAssociatedWithVirtualWans = + new VpnServerConfigurationsAssociatedWithVirtualWansClientImpl(this); + this.virtualHubRouteTableV2S = new VirtualHubRouteTableV2SClientImpl(this); + this.expressRouteGateways = new ExpressRouteGatewaysClientImpl(this); + this.expressRouteConnections = new ExpressRouteConnectionsClientImpl(this); + this.virtualHubBgpConnections = new VirtualHubBgpConnectionsClientImpl(this); + this.virtualHubIpConfigurations = new VirtualHubIpConfigurationsClientImpl(this); + this.hubRouteTables = new HubRouteTablesClientImpl(this); + this.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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..96d2dd57b5216 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterface; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkProfileImpl implements NetworkProfile, NetworkProfile.Definition, NetworkProfile.Update { + private NetworkProfileInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..92095bea992b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,1390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.NetworkProfileListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public final class NetworkProfilesClientImpl implements NetworkProfilesClient { + private final ClientLogger logger = new ClientLogger(NetworkProfilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkProfilesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkProfilesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkProfilesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkProfileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles/{networkProfileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkProfileName") String networkProfileName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkProfileName) { + return beginDeleteAsync(resourceGroupName, networkProfileName).getSyncPoller(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkProfileName, Context context) { + return beginDeleteAsync(resourceGroupName, networkProfileName, context).getSyncPoller(); + } + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkProfileName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkProfileName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner getByResourceGroup(String resourceGroupName, String networkProfileName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkProfileName, expand).block(); + } + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner createOrUpdate( + String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkProfileName, parameters).block(); + } + + /** + * Creates or updates a network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to the create or update network profile operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkProfileName, parameters).block(); + } + + /** + * Updates network profile tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the network profile. + * @param parameters Parameters supplied to update network profile tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network profile resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the network profiles in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the network profiles in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..4dbeb1964664b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkProfilesImpl implements NetworkProfiles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfilesImpl.class); + + private final NetworkProfilesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkProfilesImpl( + NetworkProfilesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkProfileName) { + this.serviceClient().delete(resourceGroupName, networkProfileName); + } + + public void delete(String resourceGroupName, String networkProfileName, Context context) { + this.serviceClient().delete(resourceGroupName, networkProfileName, context); + } + + public NetworkProfile getByResourceGroup(String resourceGroupName, String networkProfileName) { + NetworkProfileInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkProfileName); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public NetworkProfile getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkProfileName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = Utils.getValueFromIdByName(id, "networkProfiles"); + if (networkProfileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkProfiles'.", id))); + } + this.delete(resourceGroupName, networkProfileName, context); + } + + private NetworkProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkProfileImpl define(String name) { + return new NetworkProfileImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java new file mode 100644 index 0000000000000..71ad7de6285e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.FlowLog; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class NetworkSecurityGroupImpl + implements NetworkSecurityGroup, NetworkSecurityGroup.Definition, NetworkSecurityGroup.Update { + private NetworkSecurityGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String id() { + return this.innerModel().id(); + } + + 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 NetworkSecurityGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkSecurityGroupName; + + private TagsObject updateParameters; + + public NetworkSecurityGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkSecurityGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .createOrUpdate(resourceGroupName, networkSecurityGroupName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkSecurityGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .createOrUpdate(resourceGroupName, networkSecurityGroupName, this.innerModel(), context); + return this; + } + + NetworkSecurityGroupImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkSecurityGroupInner(); + this.serviceManager = serviceManager; + this.networkSecurityGroupName = name; + } + + public NetworkSecurityGroupImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkSecurityGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .updateTagsWithResponse(resourceGroupName, networkSecurityGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkSecurityGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .updateTagsWithResponse(resourceGroupName, networkSecurityGroupName, updateParameters, context) + .getValue(); + return this; + } + + NetworkSecurityGroupImpl( + NetworkSecurityGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + } + + public NetworkSecurityGroup refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkSecurityGroup refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkSecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, context) + .getValue(); + return this; + } + + public NetworkSecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkSecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkSecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkSecurityGroupImpl withSecurityRules(List securityRules) { + this.innerModel().withSecurityRules(securityRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java new file mode 100644 index 0000000000000..881f56e0649da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java @@ -0,0 +1,1525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroupListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkSecurityGroupsClient. */ +public final class NetworkSecurityGroupsClientImpl implements NetworkSecurityGroupsClient { + private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkSecurityGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkSecurityGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(NetworkSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkSecurityGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkSecurityGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkSecurityGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName).getSyncPoller(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, context).getSyncPoller(); + } + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkSecurityGroupName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkSecurityGroupName, expand).block(); + } + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + NetworkSecurityGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create or update network security group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityGroupInner updateTags( + String resourceGroupName, String networkSecurityGroupName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkSecurityGroupName, parameters).block(); + } + + /** + * Updates a network security group tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to update network security group tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkSecurityGroup resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network security groups in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..10f0c08ba7a93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkSecurityGroupsImpl implements NetworkSecurityGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupsImpl.class); + + private final NetworkSecurityGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkSecurityGroupsImpl( + NetworkSecurityGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName); + } + + public void delete(String resourceGroupName, String networkSecurityGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, context); + } + + public NetworkSecurityGroup getByResourceGroup(String resourceGroupName, String networkSecurityGroupName) { + NetworkSecurityGroupInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkSecurityGroupName); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkSecurityGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public NetworkSecurityGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, context); + } + + private NetworkSecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkSecurityGroupImpl define(String name) { + return new NetworkSecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java new file mode 100644 index 0000000000000..921096ebbdb73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkVirtualApplianceImpl + implements NetworkVirtualAppliance, NetworkVirtualAppliance.Definition, NetworkVirtualAppliance.Update { + private NetworkVirtualApplianceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NetworkVirtualApplianceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private TagsObject updateParameters; + + public NetworkVirtualApplianceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkVirtualAppliance create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, this.innerModel(), Context.NONE); + return this; + } + + public NetworkVirtualAppliance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, this.innerModel(), context); + return this; + } + + NetworkVirtualApplianceImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkVirtualApplianceInner(); + this.serviceManager = serviceManager; + this.networkVirtualApplianceName = name; + } + + public NetworkVirtualApplianceImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkVirtualAppliance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .updateTagsWithResponse(resourceGroupName, networkVirtualApplianceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkVirtualAppliance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .updateTagsWithResponse(resourceGroupName, networkVirtualApplianceName, updateParameters, context) + .getValue(); + return this; + } + + NetworkVirtualApplianceImpl( + NetworkVirtualApplianceInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + } + + public NetworkVirtualAppliance refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse( + resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public NetworkVirtualAppliance refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getNetworkVirtualAppliances() + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, context) + .getValue(); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkVirtualApplianceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkVirtualApplianceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkVirtualApplianceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public NetworkVirtualApplianceImpl withNvaSku(VirtualApplianceSkuProperties nvaSku) { + this.innerModel().withNvaSku(nvaSku); + return this; + } + + public NetworkVirtualApplianceImpl withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs) { + this.innerModel().withBootStrapConfigurationBlobs(bootStrapConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs) { + this.innerModel().withCloudInitConfigurationBlobs(cloudInitConfigurationBlobs); + return this; + } + + public NetworkVirtualApplianceImpl withCloudInitConfiguration(String cloudInitConfiguration) { + this.innerModel().withCloudInitConfiguration(cloudInitConfiguration); + return this; + } + + public NetworkVirtualApplianceImpl withVirtualApplianceAsn(Long virtualApplianceAsn) { + this.innerModel().withVirtualApplianceAsn(virtualApplianceAsn); + return this; + } + + public NetworkVirtualApplianceImpl withSshPublicKey(String sshPublicKey) { + this.innerModel().withSshPublicKey(sshPublicKey); + 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..0150753bc885d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java @@ -0,0 +1,1539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkVirtualAppliancesClient. */ +public final class NetworkVirtualAppliancesClientImpl implements NetworkVirtualAppliancesClient { + private final ClientLogger logger = new ClientLogger(NetworkVirtualAppliancesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkVirtualAppliancesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkVirtualAppliancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkVirtualAppliancesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(NetworkVirtualAppliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkVirtualAppliances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkVirtualAppliancesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkVirtualApplianceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName).getSyncPoller(); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, context).getSyncPoller(); + } + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String networkVirtualApplianceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner getByResourceGroup( + String resourceGroupName, String networkVirtualApplianceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, networkVirtualApplianceName, expand).block(); + } + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInner updateTags( + String resourceGroupName, String networkVirtualApplianceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkVirtualApplianceName, parameters).block(); + } + + /** + * Updates a Network Virtual Appliance. + * + * @param resourceGroupName The resource group name of Network Virtual Appliance. + * @param networkVirtualApplianceName The name of Network Virtual Appliance being updated. + * @param parameters Parameters supplied to Update Network Virtual Appliance Tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualAppliance Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..48a673afe173a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkVirtualAppliancesImpl implements NetworkVirtualAppliances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualAppliancesImpl.class); + + private final NetworkVirtualAppliancesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkVirtualAppliancesImpl( + NetworkVirtualAppliancesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String networkVirtualApplianceName) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName); + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, Context context) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, context); + } + + public NetworkVirtualAppliance getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName) { + NetworkVirtualApplianceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, networkVirtualApplianceName); + if (inner != null) { + return new NetworkVirtualApplianceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkVirtualApplianceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public NetworkVirtualAppliance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, context); + } + + private NetworkVirtualAppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkVirtualApplianceImpl define(String name) { + return new NetworkVirtualApplianceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java new file mode 100644 index 0000000000000..99b031eed61b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; +import java.util.Collections; +import java.util.Map; + +public final class NetworkWatcherImpl implements NetworkWatcher, NetworkWatcher.Definition, NetworkWatcher.Update { + private NetworkWatcherInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 NetworkWatcherInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkWatcherName; + + private TagsObject updateParameters; + + public NetworkWatcherImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkWatcher create() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .createOrUpdateWithResponse(resourceGroupName, networkWatcherName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .createOrUpdateWithResponse(resourceGroupName, networkWatcherName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkWatcherImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkWatcherInner(); + this.serviceManager = serviceManager; + this.networkWatcherName = name; + } + + public NetworkWatcherImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public NetworkWatcher apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .updateTagsWithResponse(resourceGroupName, networkWatcherName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .updateTagsWithResponse(resourceGroupName, networkWatcherName, updateParameters, context) + .getValue(); + return this; + } + + NetworkWatcherImpl( + NetworkWatcherInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = Utils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + } + + public NetworkWatcher refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE) + .getValue(); + return this; + } + + public NetworkWatcher refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNetworkWatchers() + .getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context) + .getValue(); + return this; + } + + public Topology getTopology(TopologyParameters parameters) { + return serviceManager.networkWatchers().getTopology(resourceGroupName, networkWatcherName, parameters); + } + + public Response getTopologyWithResponse(TopologyParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, context); + } + + public VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters) { + return serviceManager.networkWatchers().verifyIpFlow(resourceGroupName, networkWatcherName, parameters); + } + + public VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .verifyIpFlow(resourceGroupName, networkWatcherName, parameters, context); + } + + public NextHopResult getNextHop(NextHopParameters parameters) { + return serviceManager.networkWatchers().getNextHop(resourceGroupName, networkWatcherName, parameters); + } + + public NextHopResult getNextHop(NextHopParameters parameters, Context context) { + return serviceManager.networkWatchers().getNextHop(resourceGroupName, networkWatcherName, parameters, context); + } + + public SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters) { + return serviceManager.networkWatchers().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters); + } + + public SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, context); + } + + public TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters) { + return serviceManager.networkWatchers().getTroubleshooting(resourceGroupName, networkWatcherName, parameters); + } + + public TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTroubleshooting(resourceGroupName, networkWatcherName, parameters, context); + } + + public TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters) { + return serviceManager + .networkWatchers() + .getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters); + } + + public TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, context); + } + + public FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters) { + return serviceManager + .networkWatchers() + .setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters); + } + + public FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters, Context context) { + return serviceManager + .networkWatchers() + .setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, context); + } + + public FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters) { + return serviceManager.networkWatchers().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters); + } + + public FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, context); + } + + public ConnectivityInformation checkConnectivity(ConnectivityParameters parameters) { + return serviceManager.networkWatchers().checkConnectivity(resourceGroupName, networkWatcherName, parameters); + } + + public ConnectivityInformation checkConnectivity(ConnectivityParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .checkConnectivity(resourceGroupName, networkWatcherName, parameters, context); + } + + public AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters) { + return serviceManager + .networkWatchers() + .getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters); + } + + public AzureReachabilityReport getAzureReachabilityReport( + AzureReachabilityReportParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, context); + } + + public AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters) { + return serviceManager + .networkWatchers() + .listAvailableProviders(resourceGroupName, networkWatcherName, parameters); + } + + public AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .listAvailableProviders(resourceGroupName, networkWatcherName, parameters, context); + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters) { + return serviceManager + .networkWatchers() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters); + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters, Context context) { + return serviceManager + .networkWatchers() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, context); + } + + public NetworkWatcherImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkWatcherImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkWatcherImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java new file mode 100644 index 0000000000000..3847d6e4f6d51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java @@ -0,0 +1,4791 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkWatcherListResult; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkWatchersClient. */ +public final class NetworkWatchersClientImpl implements NetworkWatchersClient { + private final ClientLogger logger = new ClientLogger(NetworkWatchersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkWatchersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkWatchersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkWatchersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(NetworkWatchersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkWatchers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface NetworkWatchersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkWatcherInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/topology") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getTopology( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TopologyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/ipFlowVerify") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> verifyIpFlow( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VerificationIpFlowParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/nextHop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getNextHop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NextHopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/securityGroupView") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVMSecurityRules( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityGroupViewParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/troubleshoot") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getTroubleshooting( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TroubleshootingParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/queryTroubleshootResult") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getTroubleshootingResult( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") QueryTroubleshootingParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/configureFlowLog") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setFlowLogConfiguration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogInformationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/queryFlowLogStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getFlowLogStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FlowLogStatusParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/connectivityCheck") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkConnectivity( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectivityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/azureReachabilityReport") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getAzureReachabilityReport( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AzureReachabilityReportParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/availableProvidersList") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAvailableProviders( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AvailableProvidersListParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getNetworkConfigurationDiagnostic( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkConfigurationDiagnosticParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner createOrUpdate( + String resourceGroupName, String networkWatcherName, NetworkWatcherInner parameters) { + return createOrUpdateAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the network watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupAsync(resourceGroupName, networkWatcherName).block(); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName, context).block(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName).getSyncPoller(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, context).getSyncPoller(); + } + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Updates a network watcher tags. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters supplied to update network watcher tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network watcher in a resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets all network watchers by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets all network watchers by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all network watchers by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TopologyInner getTopology( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + return getTopologyAsync(resourceGroupName, networkWatcherName, parameters).block(); + } + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .verifyIpFlow( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + return beginVerifyIpFlowAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNextHop( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @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 next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @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 next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NextHopResultInner> beginGetNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + return beginGetNextHopAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVMSecurityRules( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + return beginGetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTroubleshooting( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + return beginGetTroubleshootingAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getTroubleshootingResult( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + return beginGetTroubleshootingResultAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setFlowLogConfiguration( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + return beginSetFlowLogConfigurationAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getFlowLogStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + return beginGetFlowLogStatusAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional) 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkConnectivity( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + return beginCheckConnectivityAsync(resourceGroupName, networkWatcherName, parameters, context).getSyncPoller(); + } + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAzureReachabilityReport( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @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 azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + return beginGetAzureReachabilityReportAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableProviders( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters).getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + return beginListAvailableProvidersAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getNetworkConfigurationDiagnostic( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters) + .getSyncPoller(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + return beginGetNetworkConfigurationDiagnosticAsync(resourceGroupName, networkWatcherName, parameters, context) + .getSyncPoller(); + } + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior 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..f002acb5becde --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkWatchersClient; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import com.azure.resourcemanager.network.generated.fluent.models.AzureReachabilityReportInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersList; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReport; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivityInformation; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogInformation; +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResponse; +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import com.azure.resourcemanager.network.generated.models.NetworkWatchers; +import com.azure.resourcemanager.network.generated.models.NextHopParameters; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewResult; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NetworkWatchersImpl implements NetworkWatchers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatchersImpl.class); + + private final NetworkWatchersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkWatchersImpl( + NetworkWatchersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NetworkWatcher getByResourceGroup(String resourceGroupName, String networkWatcherName) { + NetworkWatcherInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkWatcherName); + if (inner != null) { + return new NetworkWatcherImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkWatcherImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String networkWatcherName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName); + } + + public void delete(String resourceGroupName, String networkWatcherName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public Topology getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { + TopologyInner inner = this.serviceClient().getTopology(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TopologyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context) { + Response inner = + this.serviceClient().getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TopologyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + VerificationIpFlowResultInner inner = + this.serviceClient().verifyIpFlow(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new VerificationIpFlowResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + VerificationIpFlowResultInner inner = + this.serviceClient().verifyIpFlow(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new VerificationIpFlowResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public NextHopResult getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters) { + NextHopResultInner inner = this.serviceClient().getNextHop(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new NextHopResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public NextHopResult getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context) { + NextHopResultInner inner = + this.serviceClient().getNextHop(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new NextHopResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + SecurityGroupViewResultInner inner = + this.serviceClient().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new SecurityGroupViewResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + SecurityGroupViewResultInner inner = + this.serviceClient().getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new SecurityGroupViewResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshooting(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshooting(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context) { + TroubleshootingResultInner inner = + this.serviceClient().getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new TroubleshootingResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + FlowLogInformationInner inner = + this.serviceClient().setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + FlowLogInformationInner inner = + this.serviceClient().setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + FlowLogInformationInner inner = + this.serviceClient().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + FlowLogInformationInner inner = + this.serviceClient().getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new FlowLogInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + ConnectivityInformationInner inner = + this.serviceClient().checkConnectivity(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new ConnectivityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + ConnectivityInformationInner inner = + this.serviceClient().checkConnectivity(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new ConnectivityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { + AzureReachabilityReportInner inner = + this.serviceClient().getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new AzureReachabilityReportImpl(inner, this.manager()); + } else { + return null; + } + } + + public AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context) { + AzureReachabilityReportInner inner = + this.serviceClient().getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new AzureReachabilityReportImpl(inner, this.manager()); + } else { + return null; + } + } + + public AvailableProvidersList listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + AvailableProvidersListInner inner = + this.serviceClient().listAvailableProviders(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new AvailableProvidersListImpl(inner, this.manager()); + } else { + return null; + } + } + + public AvailableProvidersList listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context) { + AvailableProvidersListInner inner = + this.serviceClient().listAvailableProviders(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new AvailableProvidersListImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) { + NetworkConfigurationDiagnosticResponseInner inner = + this.serviceClient().getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters); + if (inner != null) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context) { + NetworkConfigurationDiagnosticResponseInner inner = + this + .serviceClient() + .getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, context); + if (inner != null) { + return new NetworkConfigurationDiagnosticResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkWatcher getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = Utils.getValueFromIdByName(id, "networkWatchers"); + if (networkWatcherName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'networkWatchers'.", id))); + } + this.delete(resourceGroupName, networkWatcherName, context); + } + + private NetworkWatchersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkWatcherImpl define(String name) { + return new NetworkWatcherImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java new file mode 100644 index 0000000000000..0c4e1ff61a3e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NextHopResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; +import com.azure.resourcemanager.network.generated.models.NextHopResult; +import com.azure.resourcemanager.network.generated.models.NextHopType; + +public final class NextHopResultImpl implements NextHopResult { + private NextHopResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NextHopResultImpl( + NextHopResultInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public NextHopType nextHopType() { + return this.innerModel().nextHopType(); + } + + public String nextHopIpAddress() { + return this.innerModel().nextHopIpAddress(); + } + + public String routeTableId() { + return this.innerModel().routeTableId(); + } + + public NextHopResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..25788ef01c972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.Operation; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..3442fd430e6b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Network/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Network Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..cced5e14b7376 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.OperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.network.generated.models.Operation; +import com.azure.resourcemanager.network.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java new file mode 100644 index 0000000000000..cd6f2369e6839 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OutboundRuleImpl.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.OutboundRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class OutboundRuleImpl implements OutboundRule { + private OutboundRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + OutboundRuleImpl( + OutboundRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer allocatedOutboundPorts() { + return this.innerModel().allocatedOutboundPorts(); + } + + public List frontendIpConfigurations() { + List inner = this.innerModel().frontendIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public LoadBalancerOutboundRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public Boolean enableTcpReset() { + return this.innerModel().enableTcpReset(); + } + + public Integer idleTimeoutInMinutes() { + return this.innerModel().idleTimeoutInMinutes(); + } + + public OutboundRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java new file mode 100644 index 0000000000000..1d28a813c1849 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; + +public final class P2SVpnConnectionHealthImpl implements P2SVpnConnectionHealth { + private P2SVpnConnectionHealthInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + P2SVpnConnectionHealthImpl( + P2SVpnConnectionHealthInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sasUrl() { + return this.innerModel().sasUrl(); + } + + public P2SVpnConnectionHealthInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java new file mode 100644 index 0000000000000..5fd571ec4b5f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class P2SVpnGatewayImpl implements P2SVpnGateway, P2SVpnGateway.Definition, P2SVpnGateway.Update { + private P2SVpnGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..1721432491b65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java @@ -0,0 +1,2971 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.ListP2SVpnGatewaysResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in P2SVpnGatewaysClient. */ +public final class P2SVpnGatewaysClientImpl implements P2SVpnGatewaysClient { + private final ClientLogger logger = new ClientLogger(P2SVpnGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final P2SVpnGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of P2SVpnGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + P2SVpnGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(P2SVpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientP2SVpnGateways to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface P2SVpnGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnGatewayInner p2SVpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject p2SVpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/generatevpnprofile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateVpnProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") P2SVpnProfileParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getP2SVpnConnectionHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getP2SVpnConnectionHealthDetailed( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionHealthRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disconnectP2SVpnConnections( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("p2sVpnGatewayName") String p2SVpnGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public P2SVpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context) + .getSyncPoller(); + } + + /** + * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + p2SVpnGatewayParameters, + accept, + context); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).getSyncPoller(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Updates virtual wan p2s vpn gateway tags. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param p2SVpnGatewayParameters Parameters supplied to update a virtual wan p2s vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getP2SVpnConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginGetP2SVpnConnectionHealth( + String resourceGroupName, String gatewayName, Context context) { + return beginGetP2SVpnConnectionHealthAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getP2SVpnConnectionHealthDetailed( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + request, + accept, + context); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request).getSyncPoller(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + return beginGetP2SVpnConnectionHealthDetailedAsync(resourceGroupName, gatewayName, request, context) + .getSyncPoller(); + } + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request).getSyncPoller(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectP2SVpnConnectionsAsync(resourceGroupName, p2SVpnGatewayName, request, context) + .getSyncPoller(); + } + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..b33fd1118e8e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.P2SVpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnConnectionHealthInner; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealth; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateways; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class P2SVpnGatewaysImpl implements P2SVpnGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnGatewaysImpl.class); + + private final P2SVpnGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public P2SVpnGatewaysImpl( + P2SVpnGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public P2SVpnGateway getByResourceGroup(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new P2SVpnGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String gatewayName) { + this.serviceClient().delete(resourceGroupName, gatewayName); + } + + public void delete(String resourceGroupName, String gatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway reset(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + VpnProfileResponseInner inner = + this.serviceClient().generateVpnProfile(resourceGroupName, gatewayName, parameters, context); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName) { + P2SVpnGatewayInner inner = this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context) { + P2SVpnGatewayInner inner = + this.serviceClient().getP2SVpnConnectionHealth(resourceGroupName, gatewayName, context); + if (inner != null) { + return new P2SVpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context) { + P2SVpnConnectionHealthInner inner = + this.serviceClient().getP2SVpnConnectionHealthDetailed(resourceGroupName, gatewayName, request, context); + if (inner != null) { + return new P2SVpnConnectionHealthImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request); + } + + public void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + this.serviceClient().disconnectP2SVpnConnections(resourceGroupName, p2SVpnGatewayName, request, context); + } + + public P2SVpnGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "p2svpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'p2svpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private P2SVpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public P2SVpnGatewayImpl define(String name) { + return new P2SVpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java new file mode 100644 index 0000000000000..a7521f857d909 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCaptureQueryStatusResult; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class PacketCaptureQueryStatusResultImpl implements PacketCaptureQueryStatusResult { + private PacketCaptureQueryStatusResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PacketCaptureQueryStatusResultImpl( + PacketCaptureQueryStatusResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime captureStartTime() { + return this.innerModel().captureStartTime(); + } + + public PcStatus packetCaptureStatus() { + return this.innerModel().packetCaptureStatus(); + } + + public String stopReason() { + return this.innerModel().stopReason(); + } + + public List packetCaptureError() { + List inner = this.innerModel().packetCaptureError(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PacketCaptureQueryStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java new file mode 100644 index 0000000000000..6d73b4c4a9ef3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class PacketCaptureResultImpl implements PacketCaptureResult { + private PacketCaptureResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PacketCaptureResultImpl( + PacketCaptureResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String target() { + return this.innerModel().target(); + } + + public Long bytesToCapturePerPacket() { + return this.innerModel().bytesToCapturePerPacket(); + } + + public Long totalBytesPerSession() { + return this.innerModel().totalBytesPerSession(); + } + + public Integer timeLimitInSeconds() { + return this.innerModel().timeLimitInSeconds(); + } + + public PacketCaptureStorageLocation storageLocation() { + return this.innerModel().storageLocation(); + } + + public List filters() { + List inner = this.innerModel().filters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public 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..4909ce9ef205e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java @@ -0,0 +1,1624 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PacketCapturesClient. */ +public final class PacketCapturesClientImpl implements PacketCapturesClient { + private final ClientLogger logger = new ClientLogger(PacketCapturesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PacketCapturesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PacketCapturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PacketCapturesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PacketCapturesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPacketCaptures to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PacketCapturesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PacketCapture parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @PathParam("packetCaptureName") String packetCaptureName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkWatchers/{networkWatcherName}/packetCaptures") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkWatcherName") String networkWatcherName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).getSyncPoller(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + return beginCreateAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context) + .getSyncPoller(); + } + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getAsync(resourceGroupName, networkWatcherName, packetCaptureName).block(); + } + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginDeleteAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginStopAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStatus( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + packetCaptureName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @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 status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @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 status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName).getSyncPoller(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return beginGetStatusAsync(resourceGroupName, networkWatcherName, packetCaptureName, context).getSyncPoller(); + } + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkWatcherName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkWatcherName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkWatcherName, context)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName)); + } + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkWatcherName, context)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java new file mode 100644 index 0000000000000..6b7d8c8596983 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PacketCapturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureQueryStatusResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureQueryStatusResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptureResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptures; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PacketCapturesImpl implements PacketCaptures { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCapturesImpl.class); + + private final PacketCapturesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PacketCapturesImpl( + PacketCapturesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PacketCaptureResult create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + PacketCaptureResultInner inner = + this.serviceClient().create(resourceGroupName, networkWatcherName, packetCaptureName, parameters); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureResult create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context) { + PacketCaptureResultInner inner = + this.serviceClient().create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, context); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureResult get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCaptureResultInner inner = + this.serviceClient().get(resourceGroupName, networkWatcherName, packetCaptureName); + if (inner != null) { + return new PacketCaptureResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkWatcherName, packetCaptureName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PacketCaptureResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, packetCaptureName); + } + + public void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + this.serviceClient().delete(resourceGroupName, networkWatcherName, packetCaptureName, context); + } + + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, packetCaptureName); + } + + public void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + this.serviceClient().stop(resourceGroupName, networkWatcherName, packetCaptureName, context); + } + + public PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName) { + PacketCaptureQueryStatusResultInner inner = + this.serviceClient().getStatus(resourceGroupName, networkWatcherName, packetCaptureName); + if (inner != null) { + return new PacketCaptureQueryStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + PacketCaptureQueryStatusResultInner inner = + this.serviceClient().getStatus(resourceGroupName, networkWatcherName, packetCaptureName, context); + if (inner != null) { + return new PacketCaptureQueryStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkWatcherName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName); + return Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkWatcherName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkWatcherName, context); + return Utils.mapPage(inner, inner1 -> new PacketCaptureResultImpl(inner1, this.manager())); + } + + private PacketCapturesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java new file mode 100644 index 0000000000000..9d9c1793395cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PeerExpressRouteCircuitConnectionImpl implements PeerExpressRouteCircuitConnection { + private PeerExpressRouteCircuitConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerExpressRouteCircuitConnectionImpl( + PeerExpressRouteCircuitConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource expressRouteCircuitPeering() { + return this.innerModel().expressRouteCircuitPeering(); + } + + public SubResource peerExpressRouteCircuitPeering() { + return this.innerModel().peerExpressRouteCircuitPeering(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public String connectionName() { + return this.innerModel().connectionName(); + } + + public String authResourceGuid() { + return this.innerModel().authResourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PeerExpressRouteCircuitConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java new file mode 100644 index 0000000000000..8d4c13e7ef81f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PeerExpressRouteCircuitConnectionsClient. + */ +public final class PeerExpressRouteCircuitConnectionsClientImpl implements PeerExpressRouteCircuitConnectionsClient { + private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PeerExpressRouteCircuitConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PeerExpressRouteCircuitConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PeerExpressRouteCircuitConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + PeerExpressRouteCircuitConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPeerExpressRouteCircuitConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PeerExpressRouteCircuitConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("circuitName") String circuitName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeerExpressRouteCircuitConnectionInner get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + return getAsync(resourceGroupName, circuitName, peeringName, connectionName).block(); + } + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit 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 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + circuitName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, circuitName, peeringName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName)); + } + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, circuitName, peeringName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPeeredConnections API service call retrieves all global reach peer circuit connections + * that belongs to a Private Peering for an ExpressRouteCircuit 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..156805ff3e35d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PeerExpressRouteCircuitConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnection; +import com.azure.resourcemanager.network.generated.models.PeerExpressRouteCircuitConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PeerExpressRouteCircuitConnectionsImpl implements PeerExpressRouteCircuitConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionsImpl.class); + + private final PeerExpressRouteCircuitConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PeerExpressRouteCircuitConnectionsImpl( + PeerExpressRouteCircuitConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PeerExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName) { + PeerExpressRouteCircuitConnectionInner inner = + this.serviceClient().get(resourceGroupName, circuitName, peeringName, connectionName); + if (inner != null) { + return new PeerExpressRouteCircuitConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PeerExpressRouteCircuitConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, circuitName, peeringName, context); + return Utils.mapPage(inner, inner1 -> new PeerExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + private PeerExpressRouteCircuitConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java new file mode 100644 index 0000000000000..9e64973f45636 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerRouteListImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import java.util.Collections; +import java.util.List; + +public final class PeerRouteListImpl implements PeerRouteList { + private PeerRouteListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PeerRouteListImpl( + PeerRouteListInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PeerRouteListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java new file mode 100644 index 0000000000000..194f6caac42ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class PrivateDnsZoneGroupImpl implements PrivateDnsZoneGroup { + private PrivateDnsZoneGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateDnsZoneGroupImpl( + PrivateDnsZoneGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateDnsZoneConfigs() { + List inner = this.innerModel().privateDnsZoneConfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateDnsZoneGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java new file mode 100644 index 0000000000000..826de1d5f2411 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroupListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateDnsZoneGroupsClient. */ +public final class PrivateDnsZoneGroupsClientImpl implements PrivateDnsZoneGroupsClient { + private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateDnsZoneGroupsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateDnsZoneGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateDnsZoneGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateDnsZoneGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateDnsZoneGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateDnsZoneGroupsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("privateDnsZoneGroupName") String privateDnsZoneGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateDnsZoneGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("privateEndpointName") String privateEndpointName, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).getSyncPoller(); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateDnsZoneGroupInner get( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + return getAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName).block(); + } + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + privateDnsZoneGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + privateEndpointName, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String privateEndpointName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(privateEndpointName, resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String privateEndpointName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(privateEndpointName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String privateEndpointName, String resourceGroupName) { + return new PagedIterable<>(listAsync(privateEndpointName, resourceGroupName)); + } + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String privateEndpointName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(privateEndpointName, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateDnsZoneGroups API service call 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 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..a9bb4ac99217c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PrivateDnsZoneGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroup; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateDnsZoneGroupsImpl implements PrivateDnsZoneGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupsImpl.class); + + private final PrivateDnsZoneGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateDnsZoneGroupsImpl( + PrivateDnsZoneGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, privateDnsZoneGroupName); + } + + public void delete( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context); + } + + public PrivateDnsZoneGroup get( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName) { + PrivateDnsZoneGroupInner inner = + this.serviceClient().get(resourceGroupName, privateEndpointName, privateDnsZoneGroupName); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateDnsZoneGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + PrivateDnsZoneGroupInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context) { + PrivateDnsZoneGroupInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, parameters, context); + if (inner != null) { + return new PrivateDnsZoneGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String privateEndpointName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(privateEndpointName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String privateEndpointName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(privateEndpointName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateDnsZoneGroupImpl(inner1, this.manager())); + } + + private PrivateDnsZoneGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ca421a59f9b8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public PrivateEndpoint privateEndpoint() { + PrivateEndpointInner inner = this.innerModel().privateEndpoint(); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String linkIdentifier() { + return this.innerModel().linkIdentifier(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..917ad2cd79180 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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..2a7ebd93c58bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java @@ -0,0 +1,1304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointsClient. */ +public final class PrivateEndpointsClientImpl implements PrivateEndpointsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateEndpointsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints/{privateEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateEndpointName") String privateEndpointName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointName) { + return beginDeleteAsync(resourceGroupName, privateEndpointName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, privateEndpointName, context).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String privateEndpointName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointInner getByResourceGroup(String resourceGroupName, String privateEndpointName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, privateEndpointName, expand).block(); + } + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + privateEndpointName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateEndpointName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an private endpoint in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param parameters Parameters supplied to the create or update private endpoint operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private endpoints in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateEndpoints API service call 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 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 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 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..d824ae267dec8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PrivateEndpointsClient; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointsImpl implements PrivateEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointsImpl.class); + + private final PrivateEndpointsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateEndpointsImpl( + PrivateEndpointsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String privateEndpointName) { + this.serviceClient().delete(resourceGroupName, privateEndpointName); + } + + public void delete(String resourceGroupName, String privateEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, privateEndpointName, context); + } + + public PrivateEndpoint getByResourceGroup(String resourceGroupName, String privateEndpointName) { + PrivateEndpointInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateEndpointName); + if (inner != null) { + return new PrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PrivateEndpoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = Utils.getValueFromIdByName(id, "privateEndpoints"); + if (privateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpoints'.", id))); + } + this.delete(resourceGroupName, privateEndpointName, context); + } + + private PrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateEndpointImpl define(String name) { + return new PrivateEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java new file mode 100644 index 0000000000000..7ec1abdaba6a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class PrivateLinkServiceImpl + implements PrivateLinkService, PrivateLinkService.Definition, PrivateLinkService.Update { + private PrivateLinkServiceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..130d4eacf1db3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java @@ -0,0 +1,3492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkServicesResult; +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkServicesClient. */ +public final class PrivateLinkServicesClientImpl implements PrivateLinkServicesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkServicesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkServicesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PrivateLinkServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPrivateLinkServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PrivateLinkServicesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateLinkServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getPrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> updatePrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> deletePrivateEndpointConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("peConnectionName") String peConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/privateLinkServices/{serviceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listPrivateEndpointConnections( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/checkPrivateLinkServiceVisibility") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkPrivateLinkServiceVisibility( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckPrivateLinkServiceVisibilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/checkPrivateLinkServiceVisibility") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> checkPrivateLinkServiceVisibilityByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckPrivateLinkServiceVisibilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}" + + "/autoApprovedPrivateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServices( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations" + + "/{location}/autoApprovedPrivateLinkServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServicesByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listPrivateEndpointConnectionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServicesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAutoApprovedPrivateLinkServicesByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkServiceInner getByResourceGroup(String resourceGroupName, String serviceName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, serviceName, expand).block(); + } + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an private link service in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param parameters Parameters supplied to the create or update private link service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link service resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private link service in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPrivateEndpointConnection( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + peConnectionName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateEndpointConnectionAsync( + String resourceGroupName, String serviceName, String peConnectionName, String expand) { + return getPrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + final String expand = null; + return getPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, expand).block(); + } + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + return updatePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, parameters) + .block(); + } + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName) + .getSyncPoller(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateEndpointConnections( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateEndpointConnectionsAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listPrivateEndpointConnectionsSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listPrivateEndpointConnectionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, serviceName)); + } + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listPrivateEndpointConnectionsAsync(resourceGroupName, serviceName, context)); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkPrivateLinkServiceVisibility( + this.client.getEndpoint(), + location, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility(String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters).getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + return beginCheckPrivateLinkServiceVisibilityAsync(location, parameters, context).getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkPrivateLinkServiceVisibilityByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, resourceGroupName, parameters) + .getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + return beginCheckPrivateLinkServiceVisibilityByResourceGroupAsync( + location, resourceGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAutoApprovedPrivateLinkServices( + this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesAsync(String location) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesSinglePageAsync(location), + nextLink -> listAutoApprovedPrivateLinkServicesNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesAsync( + String location, Context context) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesSinglePageAsync(location, context), + nextLink -> listAutoApprovedPrivateLinkServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServices(String location) { + return new PagedIterable<>(listAutoApprovedPrivateLinkServicesAsync(location)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context) { + return new PagedIterable<>(listAutoApprovedPrivateLinkServicesAsync(location, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAutoApprovedPrivateLinkServicesByResourceGroup( + this.client.getEndpoint(), + location, + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesByResourceGroupAsync( + String location, String resourceGroupName) { + return new PagedFlux<>( + () -> listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync(location, resourceGroupName), + nextLink -> listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAutoApprovedPrivateLinkServicesByResourceGroupAsync( + String location, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> + listAutoApprovedPrivateLinkServicesByResourceGroupSinglePageAsync(location, resourceGroupName, context), + nextLink -> listAutoApprovedPrivateLinkServicesByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName) { + return new PagedIterable<>( + listAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName)); + } + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context) { + return new PagedIterable<>( + listAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListPrivateLinkService API service call 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 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 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 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 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 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..28a3d002bd922 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PrivateLinkServicesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; +import com.azure.resourcemanager.network.generated.models.AutoApprovedPrivateLinkService; +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.network.generated.models.PrivateLinkService; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceVisibility; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkServicesImpl implements PrivateLinkServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicesImpl.class); + + private final PrivateLinkServicesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PrivateLinkServicesImpl( + PrivateLinkServicesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String serviceName) { + this.serviceClient().delete(resourceGroupName, serviceName); + } + + public void delete(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, context); + } + + public PrivateLinkService getByResourceGroup(String resourceGroupName, String serviceName) { + PrivateLinkServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, serviceName); + if (inner != null) { + return new PrivateLinkServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().getPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getPrivateEndpointConnectionWithResponse( + resourceGroupName, serviceName, peConnectionName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters) { + PrivateEndpointConnectionInner inner = + this + .serviceClient() + .updatePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updatePrivateEndpointConnectionWithResponse( + resourceGroupName, serviceName, peConnectionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName) { + this.serviceClient().deletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName); + } + + public void deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context) { + this.serviceClient().deletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, context); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateEndpointConnections(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + PrivateLinkServiceVisibilityInner inner = + this.serviceClient().checkPrivateLinkServiceVisibility(location, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + PrivateLinkServiceVisibilityInner inner = + this + .serviceClient() + .checkPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters, context); + if (inner != null) { + return new PrivateLinkServiceVisibilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAutoApprovedPrivateLinkServices(String location) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServices( + String location, Context context) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServices(location, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateLinkService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "privateLinkServices"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateLinkServices'.", id))); + } + this.delete(resourceGroupName, serviceName, context); + } + + private PrivateLinkServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PrivateLinkServiceImpl define(String name) { + return new PrivateLinkServiceImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java new file mode 100644 index 0000000000000..53213911f0783 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.azure.resourcemanager.network.generated.models.Probe; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ProbeImpl implements Probe { + private ProbeInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ProbeImpl(ProbeInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProbeProtocol protocol() { + return this.innerModel().protocol(); + } + + public int port() { + return this.innerModel().port(); + } + + public Integer intervalInSeconds() { + return this.innerModel().intervalInSeconds(); + } + + public Integer numberOfProbes() { + return this.innerModel().numberOfProbes(); + } + + public String requestPath() { + return this.innerModel().requestPath(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ProbeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java new file mode 100644 index 0000000000000..8e74695e8e12e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressMigrationPhase; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PublicIpAddressImpl implements PublicIpAddress, PublicIpAddress.Definition, PublicIpAddress.Update { + private PublicIpAddressInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PublicIpAddressSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public 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 PublicIpAddressInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publicIpAddressName; + + private TagsObject updateParameters; + + public PublicIpAddressImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PublicIpAddress create() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .createOrUpdate(resourceGroupName, publicIpAddressName, this.innerModel(), Context.NONE); + return this; + } + + public PublicIpAddress create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .createOrUpdate(resourceGroupName, publicIpAddressName, this.innerModel(), context); + return this; + } + + PublicIpAddressImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new PublicIpAddressInner(); + this.serviceManager = serviceManager; + this.publicIpAddressName = name; + } + + public PublicIpAddressImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public PublicIpAddress apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .updateTagsWithResponse(resourceGroupName, publicIpAddressName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public PublicIpAddress apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .updateTagsWithResponse(resourceGroupName, publicIpAddressName, updateParameters, context) + .getValue(); + return this; + } + + PublicIpAddressImpl( + PublicIpAddressInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpAddressName = Utils.getValueFromIdByName(innerObject.id(), "publicIPAddresses"); + } + + public PublicIpAddress refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public PublicIpAddress refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getPublicIpAddresses() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, context) + .getValue(); + return this; + } + + public PublicIpAddressImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PublicIpAddressImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PublicIpAddressImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PublicIpAddressImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PublicIpAddressImpl withSku(PublicIpAddressSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PublicIpAddressImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public PublicIpAddressImpl withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod) { + this.innerModel().withPublicIpAllocationMethod(publicIpAllocationMethod); + return this; + } + + public PublicIpAddressImpl withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.innerModel().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + public PublicIpAddressImpl withDnsSettings(PublicIpAddressDnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public PublicIpAddressImpl withDdosSettings(DdosSettings ddosSettings) { + this.innerModel().withDdosSettings(ddosSettings); + return this; + } + + public PublicIpAddressImpl withIpTags(List ipTags) { + this.innerModel().withIpTags(ipTags); + return this; + } + + public PublicIpAddressImpl withIpAddress(String ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public PublicIpAddressImpl withPublicIpPrefix(SubResource publicIpPrefix) { + this.innerModel().withPublicIpPrefix(publicIpPrefix); + return this; + } + + public PublicIpAddressImpl withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.innerModel().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + public PublicIpAddressImpl withServicePublicIpAddress(PublicIpAddressInner servicePublicIpAddress) { + this.innerModel().withServicePublicIpAddress(servicePublicIpAddress); + return this; + } + + public PublicIpAddressImpl withNatGateway(NatGatewayInner natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + public PublicIpAddressImpl withMigrationPhase(PublicIpAddressMigrationPhase migrationPhase) { + this.innerModel().withMigrationPhase(migrationPhase); + return this; + } + + public PublicIpAddressImpl withLinkedPublicIpAddress(PublicIpAddressInner linkedPublicIpAddress) { + this.innerModel().withLinkedPublicIpAddress(linkedPublicIpAddress); + return this; + } + + public PublicIpAddressImpl withDeleteOption(DeleteOptions deleteOption) { + this.innerModel().withDeleteOption(deleteOption); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..f670454456536 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java @@ -0,0 +1,3572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublicIpAddressesClient. */ +public final class PublicIpAddressesClientImpl implements PublicIpAddressesClient { + private final ClientLogger logger = new ClientLogger(PublicIpAddressesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PublicIpAddressesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIpAddressesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicIpAddressesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PublicIpAddressesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPublicIpAddresses to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PublicIpAddressesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServicePublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstancePublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces" + + "/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + + "/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCloudServicePublicIpAddress( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServiceName") String cloudServiceName, + @PathParam("roleInstanceName") String roleInstanceName, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PublicIpAddressInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPAddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMPublicIpAddresses( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" + + "/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}" + + "/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses" + + "/{publicIpAddressName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachineScaleSetPublicIpAddress( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineScaleSetName") String virtualMachineScaleSetName, + @PathParam("virtualmachineIndex") String virtualmachineIndex, + @PathParam("networkInterfaceName") String networkInterfaceName, + @PathParam("ipConfigurationName") String ipConfigurationName, + @PathParam("publicIpAddressName") String publicIpAddressName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServicePublicIpAddressesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCloudServiceRoleInstancePublicIpAddressesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetPublicIpAddressesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachineScaleSetVMPublicIpAddressesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServicePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServicePublicIpAddressesAsync( + String resourceGroupName, String cloudServiceName) { + return new PagedFlux<>( + () -> listCloudServicePublicIpAddressesSinglePageAsync(resourceGroupName, cloudServiceName), + nextLink -> listCloudServicePublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServicePublicIpAddressesAsync( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedFlux<>( + () -> listCloudServicePublicIpAddressesSinglePageAsync(resourceGroupName, cloudServiceName, context), + nextLink -> listCloudServicePublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName) { + return new PagedIterable<>(listCloudServicePublicIpAddressesAsync(resourceGroupName, cloudServiceName)); + } + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context) { + return new PagedIterable<>( + listCloudServicePublicIpAddressesAsync(resourceGroupName, cloudServiceName, context)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCloudServiceRoleInstancePublicIpAddresses( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstancePublicIpAddressesAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName), + nextLink -> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCloudServiceRoleInstancePublicIpAddressesAsync( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedFlux<>( + () -> + listCloudServiceRoleInstancePublicIpAddressesSinglePageAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context), + nextLink -> listCloudServiceRoleInstancePublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedIterable<>( + listCloudServiceRoleInstancePublicIpAddressesAsync( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName)); + } + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedIterable<>( + listCloudServiceRoleInstancePublicIpAddressesAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context)); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCloudServicePublicIpAddress( + this.client.getEndpoint(), + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service 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, + String expand) { + return getCloudServicePublicIpAddressWithResponseAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getCloudServicePublicIpAddressAsync( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .block(); + } + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpAddressName) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName).getSyncPoller(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String publicIpAddressName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpAddressName, context).getSyncPoller(); + } + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String publicIpAddressName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, publicIpAddressName, expand).block(); + } + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpAddressName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to the create or update public IP address operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner updateTags( + String resourceGroupName, String publicIpAddressName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, publicIpAddressName, parameters).block(); + } + + /** + * Updates public IP address tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param parameters Parameters supplied to update public IP address tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP address resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the public IP addresses in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName), + nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetPublicIpAddressesAsync( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetPublicIpAddressesSinglePageAsync( + resourceGroupName, virtualMachineScaleSetName, context), + nextLink -> listVirtualMachineScaleSetPublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName) { + return new PagedIterable<>( + listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName)); + } + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetPublicIpAddressesAsync(resourceGroupName, virtualMachineScaleSetName, context)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName), + nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachineScaleSetVMPublicIpAddressesAsync( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedFlux<>( + () -> + listVirtualMachineScaleSetVMPublicIpAddressesSinglePageAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context), + nextLink -> listVirtualMachineScaleSetVMPublicIpAddressesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMPublicIpAddressesAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName)); + } + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + return new PagedIterable<>( + listVirtualMachineScaleSetVMPublicIpAddressesAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context)); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set 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. + * @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 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, + String expand) { + return getVirtualMachineScaleSetPublicIpAddressWithResponseAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpAddressInner getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + final String expand = null; + return getVirtualMachineScaleSetPublicIpAddressAsync( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand) + .block(); + } + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set 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 next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..e0d5373950bfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PublicIpAddressesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PublicIpAddressesImpl implements PublicIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressesImpl.class); + + private final PublicIpAddressesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PublicIpAddressesImpl( + PublicIpAddressesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName) { + PagedIterable inner = + this.serviceClient().listCloudServicePublicIpAddresses(resourceGroupName, cloudServiceName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listCloudServicePublicIpAddresses(resourceGroupName, cloudServiceName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listCloudServiceRoleInstancePublicIpAddresses( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PublicIpAddress getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + PublicIpAddressInner inner = + this + .serviceClient() + .getCloudServicePublicIpAddress( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getCloudServicePublicIpAddressWithResponse( + resourceGroupName, + cloudServiceName, + roleInstanceName, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String publicIpAddressName) { + this.serviceClient().delete(resourceGroupName, publicIpAddressName); + } + + public void delete(String resourceGroupName, String publicIpAddressName, Context context) { + this.serviceClient().delete(resourceGroupName, publicIpAddressName, context); + } + + public PublicIpAddress getByResourceGroup(String resourceGroupName, String publicIpAddressName) { + PublicIpAddressInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listVirtualMachineScaleSetVMPublicIpAddresses( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + context); + return Utils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PublicIpAddress getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName) { + PublicIpAddressInner inner = + this + .serviceClient() + .getVirtualMachineScaleSetPublicIpAddress( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName); + if (inner != null) { + return new PublicIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineScaleSetPublicIpAddressWithResponse( + resourceGroupName, + virtualMachineScaleSetName, + virtualmachineIndex, + networkInterfaceName, + ipConfigurationName, + publicIpAddressName, + expand, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PublicIpAddress getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = Utils.getValueFromIdByName(id, "publicIPAddresses"); + if (publicIpAddressName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPAddresses'.", id))); + } + this.delete(resourceGroupName, publicIpAddressName, context); + } + + private PublicIpAddressesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpAddressImpl define(String name) { + return new PublicIpAddressImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java new file mode 100644 index 0000000000000..086c0c7f8c11a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.IpTag; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.NatGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PublicIpPrefixImpl implements PublicIpPrefix, PublicIpPrefix.Definition, PublicIpPrefix.Update { + private PublicIpPrefixInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PublicIpPrefixSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public 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 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..3221efde5c820 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PublicIpPrefixesClient. */ +public final class PublicIpPrefixesClientImpl implements PublicIpPrefixesClient { + private final ClientLogger logger = new ClientLogger(PublicIpPrefixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PublicIpPrefixesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of PublicIpPrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicIpPrefixesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(PublicIpPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientPublicIpPrefixes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface PublicIpPrefixesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PublicIpPrefixInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes/{publicIpPrefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicIpPrefixName") String publicIpPrefixName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/publicIPPrefixes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpPrefixName) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName).getSyncPoller(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String publicIpPrefixName, Context context) { + return beginDeleteAsync(resourceGroupName, publicIpPrefixName, context).getSyncPoller(); + } + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String publicIpPrefixName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, publicIpPrefixName, expand).block(); + } + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + publicIpPrefixName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicIpPrefixName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a static or dynamic public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to the create or update public IP prefix operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, publicIpPrefixName, parameters).block(); + } + + /** + * Updates public IP prefix tags. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param parameters Parameters supplied to update public IP prefix tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public IP prefix resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..e5ab2e649a52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.PublicIpPrefixesClient; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PublicIpPrefixesImpl implements PublicIpPrefixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixesImpl.class); + + private final PublicIpPrefixesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public PublicIpPrefixesImpl( + PublicIpPrefixesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + this.serviceClient().delete(resourceGroupName, publicIpPrefixName); + } + + public void delete(String resourceGroupName, String publicIpPrefixName, Context context) { + this.serviceClient().delete(resourceGroupName, publicIpPrefixName, context); + } + + public PublicIpPrefix getByResourceGroup(String resourceGroupName, String publicIpPrefixName) { + PublicIpPrefixInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, publicIpPrefixName); + if (inner != null) { + return new PublicIpPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PublicIpPrefixImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PublicIpPrefix getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = Utils.getValueFromIdByName(id, "publicIPPrefixes"); + if (publicIpPrefixName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'publicIPPrefixes'.", id))); + } + this.delete(resourceGroupName, publicIpPrefixName, context); + } + + private PublicIpPrefixesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public PublicIpPrefixImpl define(String name) { + return new PublicIpPrefixImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..0457ea99e34f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceNavigationLinksClient. */ +public final class ResourceNavigationLinksClientImpl implements ResourceNavigationLinksClient { + private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceNavigationLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ResourceNavigationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceNavigationLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ResourceNavigationLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientResourceNavigationLinks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ResourceNavigationLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceNavigationLinksListResultInner list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet 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(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java new file mode 100644 index 0000000000000..e41140d36ca9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ResourceNavigationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinks; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinksListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceNavigationLinksImpl implements ResourceNavigationLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLinksImpl.class); + + private final ResourceNavigationLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ResourceNavigationLinksImpl( + ResourceNavigationLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceNavigationLinksListResult list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + ResourceNavigationLinksListResultInner inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new ResourceNavigationLinksListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, virtualNetworkName, subnetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceNavigationLinksListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceNavigationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java new file mode 100644 index 0000000000000..bdd3c4cbbed88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ResourceNavigationLinksListResultImpl implements ResourceNavigationLinksListResult { + private ResourceNavigationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ResourceNavigationLinksListResultImpl( + ResourceNavigationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ResourceNavigationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..b1add3062f6ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,2308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSessionListResult; +import com.azure.resourcemanager.network.generated.models.BastionSessionDeleteResult; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListResult; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientResourceProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/createShareableLinks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> putBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/deleteShareableLinks") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/getShareableLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBastionShareableLink( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkListRequest bslRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/getActiveSessions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getActiveSessions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/bastionHosts/{bastionHostName}/disconnectActiveSessions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disconnectActiveSessions( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SessionIds sessionIds, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkDnsNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("domainNameLabel") String domainNameLabel, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/supportedSecurityProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> supportedSecurityProviders( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/GenerateVpnProfile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generatevirtualwanvpnserverconfigurationvpnprofile( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualWanVpnProfileParameters vpnClientParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> putBastionShareableLinkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBastionShareableLinkNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getActiveSessionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disconnectActiveSessionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = + service + .putBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionShareableLinkListResult.class, + BastionShareableLinkListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux putBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedFlux<>( + () -> putBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest), + nextLink -> putBastionShareableLinkNextSinglePageAsync(nextLink)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux putBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedFlux<>( + () -> putBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest, context), + nextLink -> putBastionShareableLinkNextSinglePageAsync(nextLink, context)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedIterable<>(putBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest)); + } + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedIterable<>( + putBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context)); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest).getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return beginDeleteBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context) + .getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBastionShareableLink( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + bslRequest, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedFlux<>( + () -> getBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest), + nextLink -> getBastionShareableLinkNextSinglePageAsync(nextLink)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getBastionShareableLinkAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedFlux<>( + () -> getBastionShareableLinkSinglePageAsync(resourceGroupName, bastionHostname, bslRequest, context), + nextLink -> getBastionShareableLinkNextSinglePageAsync(nextLink, context)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return new PagedIterable<>(getBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest)); + } + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return new PagedIterable<>( + getBastionShareableLinkAsync(resourceGroupName, bastionHostname, bslRequest, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = + service + .getActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BastionActiveSessionListResult.class, + BastionActiveSessionListResult.class, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getActiveSessionsAsync( + String resourceGroupName, String bastionHostname) { + return new PagedFlux<>( + () -> getActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname), + nextLink -> getActiveSessionsNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getActiveSessionsAsync( + String resourceGroupName, String bastionHostname, Context context) { + return new PagedFlux<>( + () -> getActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, context), + nextLink -> getActiveSessionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname) { + return new PagedIterable<>(getActiveSessionsAsync(resourceGroupName, bastionHostname)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context) { + return new PagedIterable<>(getActiveSessionsAsync(resourceGroupName, bastionHostname, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disconnectActiveSessions( + this.client.getEndpoint(), + resourceGroupName, + bastionHostname, + apiVersion, + this.client.getSubscriptionId(), + sessionIds, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux disconnectActiveSessionsAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + return new PagedFlux<>( + () -> disconnectActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, sessionIds), + nextLink -> disconnectActiveSessionsNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux disconnectActiveSessionsAsync( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + return new PagedFlux<>( + () -> disconnectActiveSessionsSinglePageAsync(resourceGroupName, bastionHostname, sessionIds, context), + nextLink -> disconnectActiveSessionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + return new PagedIterable<>(disconnectActiveSessionsAsync(resourceGroupName, bastionHostname, sessionIds)); + } + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + return new PagedIterable<>( + disconnectActiveSessionsAsync(resourceGroupName, bastionHostname, sessionIds, context)); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) { + return checkDnsNameAvailabilityAsync(location, domainNameLabel).block(); + } + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context) { + return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel, context).block(); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanSecurityProvidersInner supportedSecurityProviders( + String resourceGroupName, String virtualWanName) { + return supportedSecurityProvidersAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName, context).block(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatevirtualwanvpnserverconfigurationvpnprofile( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + vpnClientParams, + accept, + context); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams) + .getSyncPoller(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + return beginGeneratevirtualwanvpnserverconfigurationvpnprofileAsync( + resourceGroupName, virtualWanName, vpnClientParams, context) + .getSyncPoller(); + } + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..acf3d6b529243 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.BastionActiveSession; +import com.azure.resourcemanager.network.generated.models.BastionSessionState; +import com.azure.resourcemanager.network.generated.models.BastionShareableLink; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; +import com.azure.resourcemanager.network.generated.models.ResourceProviders; +import com.azure.resourcemanager.network.generated.models.SessionIds; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProviders; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceProvidersImpl implements ResourceProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + PagedIterable inner = + this.serviceClient().putBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().putBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + } + + public void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + this.serviceClient().deleteBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + PagedIterable inner = + this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest, context); + return Utils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context) { + PagedIterable inner = + this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname, context); + return Utils.mapPage(inner, inner1 -> new BastionActiveSessionImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context) { + PagedIterable inner = + this.serviceClient().disconnectActiveSessions(resourceGroupName, bastionHostname, sessionIds, context); + return Utils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + public DnsNameAvailabilityResult checkDnsNameAvailability(String location, String domainNameLabel) { + DnsNameAvailabilityResultInner inner = this.serviceClient().checkDnsNameAvailability(location, domainNameLabel); + if (inner != null) { + return new DnsNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context) { + Response inner = + this.serviceClient().checkDnsNameAvailabilityWithResponse(location, domainNameLabel, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DnsNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualWanSecurityProviders supportedSecurityProviders(String resourceGroupName, String virtualWanName) { + VirtualWanSecurityProvidersInner inner = + this.serviceClient().supportedSecurityProviders(resourceGroupName, virtualWanName); + if (inner != null) { + return new VirtualWanSecurityProvidersImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + Response inner = + this.serviceClient().supportedSecurityProvidersWithResponse(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualWanSecurityProvidersImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams) { + VpnProfileResponseInner inner = + this + .serviceClient() + .generatevirtualwanvpnserverconfigurationvpnprofile(resourceGroupName, virtualWanName, vpnClientParams); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context) { + VpnProfileResponseInner inner = + this + .serviceClient() + .generatevirtualwanvpnserverconfigurationvpnprofile( + resourceGroupName, virtualWanName, vpnClientParams, context); + if (inner != null) { + return new VpnProfileResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java new file mode 100644 index 0000000000000..931dea7279f9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeering; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RouteFilterImpl implements RouteFilter, RouteFilter.Definition, RouteFilter.Update { + private RouteFilterInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..f1defea2aac51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RouteFilterRulesClient. */ +public final class RouteFilterRulesClientImpl implements RouteFilterRulesClient { + private final ClientLogger logger = new ClientLogger(RouteFilterRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteFilterRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFilterRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteFilterRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteFilterRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteFilterRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteFilterRulesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @PathParam("ruleName") String ruleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteFilterRuleInner routeFilterRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}/routeFilterRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRouteFilter( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRouteFilterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeFilterName, String ruleName) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName).getSyncPoller(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeFilterName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getAsync(resourceGroupName, routeFilterName, ruleName).block(); + } + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + ruleName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterRuleParameters, + accept, + context); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRouteFilter( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRouteFilterAsync(String resourceGroupName, String routeFilterName) { + return new PagedFlux<>( + () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName), + nextLink -> listByRouteFilterNextSinglePageAsync(nextLink)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRouteFilterAsync( + String resourceGroupName, String routeFilterName, Context context) { + return new PagedFlux<>( + () -> listByRouteFilterSinglePageAsync(resourceGroupName, routeFilterName, context), + nextLink -> listByRouteFilterNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName) { + return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName)); + } + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context) { + return new PagedIterable<>(listByRouteFilterAsync(resourceGroupName, routeFilterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilterRules API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..2c64f292da5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.RouteFilterRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterRule; +import com.azure.resourcemanager.network.generated.models.RouteFilterRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteFilterRulesImpl implements RouteFilterRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRulesImpl.class); + + private final RouteFilterRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteFilterRulesImpl( + RouteFilterRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String routeFilterName, String ruleName) { + this.serviceClient().delete(resourceGroupName, routeFilterName, ruleName); + } + + public void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context) { + this.serviceClient().delete(resourceGroupName, routeFilterName, ruleName, context); + } + + public RouteFilterRule get(String resourceGroupName, String routeFilterName, String ruleName) { + RouteFilterRuleInner inner = this.serviceClient().get(resourceGroupName, routeFilterName, ruleName); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, routeFilterName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteFilterRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + RouteFilterRuleInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context) { + RouteFilterRuleInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, context); + if (inner != null) { + return new RouteFilterRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName) { + PagedIterable inner = + this.serviceClient().listByRouteFilter(resourceGroupName, routeFilterName); + return Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByRouteFilter( + String resourceGroupName, String routeFilterName, Context context) { + PagedIterable inner = + this.serviceClient().listByRouteFilter(resourceGroupName, routeFilterName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterRuleImpl(inner1, this.manager())); + } + + private RouteFilterRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java new file mode 100644 index 0000000000000..bf9dbb9d269f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java @@ -0,0 +1,1492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.RouteFilterListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RouteFiltersClient. */ +public final class RouteFiltersClientImpl implements RouteFiltersClient { + private final ClientLogger logger = new ClientLogger(RouteFiltersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteFiltersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteFiltersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteFilters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteFiltersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteFilterInner routeFilterParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters/{routeFilterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeFilterName") String routeFilterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName) { + return beginDeleteAsync(resourceGroupName, routeFilterName).getSyncPoller(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeFilterName, Context context) { + return beginDeleteAsync(resourceGroupName, routeFilterName, context).getSyncPoller(); + } + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String routeFilterName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner getByResourceGroup(String resourceGroupName, String routeFilterName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, routeFilterName, expand).block(); + } + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeFilterName, + apiVersion, + this.client.getSubscriptionId(), + routeFilterParameters, + accept, + context); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters).getSyncPoller(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeFilterName, routeFilterParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route filter in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param routeFilterParameters Parameters supplied to the create or update route filter operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteFilterInner updateTags(String resourceGroupName, String routeFilterName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, routeFilterName, parameters).block(); + } + + /** + * Updates tags of a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param parameters Parameters supplied to update route filter tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route filters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route filters in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all route filters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilters API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..3e33310d0f075 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.RouteFiltersClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import com.azure.resourcemanager.network.generated.models.RouteFilters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteFiltersImpl implements RouteFilters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFiltersImpl.class); + + private final RouteFiltersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteFiltersImpl( + RouteFiltersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String routeFilterName) { + this.serviceClient().delete(resourceGroupName, routeFilterName); + } + + public void delete(String resourceGroupName, String routeFilterName, Context context) { + this.serviceClient().delete(resourceGroupName, routeFilterName, context); + } + + public RouteFilter getByResourceGroup(String resourceGroupName, String routeFilterName) { + RouteFilterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, routeFilterName); + if (inner != null) { + return new RouteFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public RouteFilter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeFilterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = Utils.getValueFromIdByName(id, "routeFilters"); + if (routeFilterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeFilters'.", id))); + } + this.delete(resourceGroupName, routeFilterName, context); + } + + private RouteFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteFilterImpl define(String name) { + return new RouteFilterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java new file mode 100644 index 0000000000000..83ab1d9e50d90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; + +public final class RouteImpl implements Route, Route.Definition, Route.Update { + private RouteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public RouteNextHopType nextHopType() { + return this.innerModel().nextHopType(); + } + + public String nextHopIpAddress() { + return this.innerModel().nextHopIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Boolean hasBgpOverride() { + return this.innerModel().hasBgpOverride(); + } + + public RouteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String routeTableName; + + private String routeName; + + public RouteImpl withExistingRouteTable(String resourceGroupName, String routeTableName) { + this.resourceGroupName = resourceGroupName; + this.routeTableName = routeTableName; + return this; + } + + public Route create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RouteInner(); + this.serviceManager = serviceManager; + this.routeName = name; + } + + public RouteImpl update() { + return this; + } + + public Route apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), Context.NONE); + return this; + } + + public Route apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .createOrUpdate(resourceGroupName, routeTableName, routeName, this.innerModel(), context); + return this; + } + + RouteImpl(RouteInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = Utils.getValueFromIdByName(innerObject.id(), "routeTables"); + this.routeName = Utils.getValueFromIdByName(innerObject.id(), "routes"); + } + + public Route refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE) + .getValue(); + return this; + } + + public Route refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoutes() + .getWithResponse(resourceGroupName, routeTableName, routeName, context) + .getValue(); + return this; + } + + public RouteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public RouteImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public RouteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public RouteImpl withNextHopType(RouteNextHopType nextHopType) { + this.innerModel().withNextHopType(nextHopType); + return this; + } + + public RouteImpl withNextHopIpAddress(String nextHopIpAddress) { + this.innerModel().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + public RouteImpl withHasBgpOverride(Boolean hasBgpOverride) { + this.innerModel().withHasBgpOverride(hasBgpOverride); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java new file mode 100644 index 0000000000000..8b02791cfb52b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RouteTableImpl implements RouteTable, RouteTable.Definition, RouteTable.Update { + private RouteTableInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..f6dbf275b10b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java @@ -0,0 +1,1477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.RouteTableListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RouteTablesClient. */ +public final class RouteTablesClientImpl implements RouteTablesClient { + private final ClientLogger logger = new ClientLogger(RouteTablesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RouteTablesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteTablesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(RouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteTables to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RouteTablesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteTableInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, routeTableName).getSyncPoller(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String routeTableName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner getByResourceGroup(String resourceGroupName, String routeTableName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, routeTableName, expand).block(); + } + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).getSyncPoller(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteTableInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, RouteTableInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters, context).getSyncPoller(); + } + + /** + * Create or updates a route table in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create or update route table operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, routeTableName, parameters).block(); + } + + /** + * Updates a route table tags. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to update route table tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route table resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all route tables in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all route tables in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all route tables in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteTable API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..43d8d1bfb515b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.RouteTables; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RouteTablesImpl implements RouteTables { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTablesImpl.class); + + private final RouteTablesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteTablesImpl( + RouteTablesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, routeTableName); + } + + public void delete(String resourceGroupName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, routeTableName, context); + } + + public RouteTable getByResourceGroup(String resourceGroupName, String routeTableName) { + RouteTableInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, routeTableName); + if (inner != null) { + return new RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public RouteTable getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, routeTableName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + this.delete(resourceGroupName, routeTableName, context); + } + + private RouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteTableImpl define(String name) { + return new RouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java new file mode 100644 index 0000000000000..2c44c8c08f528 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,1120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.RouteListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoutesClient. */ +public final class RoutesClientImpl implements RoutesClient { + private final ClientLogger logger = new ClientLogger(RoutesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RoutesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(RoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRoutes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface RoutesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes/{routeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @PathParam("routeName") String routeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RouteInner routeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables" + + "/{routeTableName}/routes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName).getSyncPoller(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String routeTableName, String routeName, Context context) { + return beginDeleteAsync(resourceGroupName, routeTableName, routeName, context).getSyncPoller(); + } + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getAsync(resourceGroupName, routeTableName, routeName).block(); + } + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + routeName, + apiVersion, + this.client.getSubscriptionId(), + routeParameters, + accept, + context); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreateOrUpdate( + String resourceGroupName, + String routeTableName, + String routeName, + RouteInner routeParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create or update route operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + routeTableName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String routeTableName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, routeTableName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String routeTableName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, routeTableName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String routeTableName) { + return new PagedIterable<>(listAsync(resourceGroupName, routeTableName)); + } + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, routeTableName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRoute API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..d591d6895b742 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.Route; +import com.azure.resourcemanager.network.generated.models.Routes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RoutesImpl implements Routes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutesImpl.class); + + private final RoutesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RoutesImpl( + RoutesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String routeTableName, String routeName) { + this.serviceClient().delete(resourceGroupName, routeTableName, routeName); + } + + public void delete(String resourceGroupName, String routeTableName, String routeName, Context context) { + this.serviceClient().delete(resourceGroupName, routeTableName, routeName, context); + } + + public Route get(String resourceGroupName, String routeTableName, String routeName) { + RouteInner inner = this.serviceClient().get(resourceGroupName, routeTableName, routeName); + if (inner != null) { + return new RouteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String routeTableName, String routeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, routeTableName, routeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RouteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String routeTableName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String routeTableName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName, context); + return Utils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Route getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + return this.getWithResponse(resourceGroupName, routeTableName, routeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = Utils.getValueFromIdByName(id, "routeTables"); + if (routeTableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeTables'.", id))); + } + String routeName = Utils.getValueFromIdByName(id, "routes"); + if (routeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routes'.", id))); + } + this.delete(resourceGroupName, routeTableName, routeName, context); + } + + private RoutesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteImpl define(String name) { + return new RouteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..7236b5ac5119b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 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..b6b5f92d6f8a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java @@ -0,0 +1,1168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(RoutingIntentsClientImpl.class); + + /** 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") + private 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 = "2021-08-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 = "2021-08-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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutingIntentInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routingIntentName, + RoutingIntentInner routingIntentParameters) { + return 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 routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutingIntentInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routingIntentName, + RoutingIntentInner routingIntentParameters, + Context context) { + return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, virtualHubName, routingIntentName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routingIntentName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routingIntentName, Context context) { + return 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..c8d6ad29231bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RoutingIntentsImpl implements RoutingIntents { + @JsonIgnore private 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 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 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 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/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..3a46e528a2f41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderConnectionStatus; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SecurityPartnerProviderImpl + implements SecurityPartnerProvider, SecurityPartnerProvider.Definition, SecurityPartnerProvider.Update { + private SecurityPartnerProviderInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..bf71ade4c5d72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java @@ -0,0 +1,1505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviderListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecurityPartnerProvidersClient. */ +public final class SecurityPartnerProvidersClientImpl implements SecurityPartnerProvidersClient { + private final ClientLogger logger = new ClientLogger(SecurityPartnerProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityPartnerProvidersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityPartnerProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityPartnerProvidersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(SecurityPartnerProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityPartnerProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SecurityPartnerProvidersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityPartnerProviderInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders/{securityPartnerProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityPartnerProviderName") String securityPartnerProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/securityPartnerProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String securityPartnerProviderName) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName).getSyncPoller(); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String securityPartnerProviderName, Context context) { + return beginDeleteAsync(resourceGroupName, securityPartnerProviderName, context).getSyncPoller(); + } + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner getByResourceGroup( + String resourceGroupName, String securityPartnerProviderName) { + return getByResourceGroupAsync(resourceGroupName, securityPartnerProviderName).block(); + } + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityPartnerProviderName, context).block(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + securityPartnerProviderName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, + String securityPartnerProviderName, + SecurityPartnerProviderInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, securityPartnerProviderName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to the create or update Security Partner Provider operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityPartnerProviderInner updateTags( + String resourceGroupName, String securityPartnerProviderName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, securityPartnerProviderName, parameters).block(); + } + + /** + * Updates tags of a Security Partner Provider resource. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param parameters Parameters supplied to update Security Partner Provider tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security Partner Provider resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..139ec62c57276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityPartnerProvidersImpl implements SecurityPartnerProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProvidersImpl.class); + + private final SecurityPartnerProvidersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityPartnerProvidersImpl( + SecurityPartnerProvidersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String securityPartnerProviderName) { + this.serviceClient().delete(resourceGroupName, securityPartnerProviderName); + } + + public void delete(String resourceGroupName, String securityPartnerProviderName, Context context) { + this.serviceClient().delete(resourceGroupName, securityPartnerProviderName, context); + } + + public SecurityPartnerProvider getByResourceGroup(String resourceGroupName, String securityPartnerProviderName) { + SecurityPartnerProviderInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, securityPartnerProviderName); + if (inner != null) { + return new SecurityPartnerProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityPartnerProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public SecurityPartnerProvider getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = Utils.getValueFromIdByName(id, "securityPartnerProviders"); + if (securityPartnerProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityPartnerProviders'.", + id))); + } + this.delete(resourceGroupName, securityPartnerProviderName, context); + } + + private SecurityPartnerProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityPartnerProviderImpl define(String name) { + return new SecurityPartnerProviderImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java new file mode 100644 index 0000000000000..5d6a750bd9a34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SecurityRuleImpl implements SecurityRule, SecurityRule.Definition, SecurityRule.Update { + private SecurityRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public SecurityRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public String sourcePortRange() { + return this.innerModel().sourcePortRange(); + } + + public String destinationPortRange() { + return this.innerModel().destinationPortRange(); + } + + public String sourceAddressPrefix() { + return this.innerModel().sourceAddressPrefix(); + } + + public List sourceAddressPrefixes() { + List inner = this.innerModel().sourceAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List sourceApplicationSecurityGroups() { + List inner = this.innerModel().sourceApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String destinationAddressPrefix() { + return this.innerModel().destinationAddressPrefix(); + } + + public List destinationAddressPrefixes() { + List inner = this.innerModel().destinationAddressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationApplicationSecurityGroups() { + List inner = this.innerModel().destinationApplicationSecurityGroups(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List sourcePortRanges() { + List inner = this.innerModel().sourcePortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationPortRanges() { + List inner = this.innerModel().destinationPortRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecurityRuleAccess access() { + return this.innerModel().access(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public SecurityRuleDirection direction() { + return this.innerModel().direction(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SecurityRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkSecurityGroupName; + + private String securityRuleName; + + public SecurityRuleImpl withExistingNetworkSecurityGroup( + String resourceGroupName, String networkSecurityGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkSecurityGroupName = networkSecurityGroupName; + return this; + } + + public SecurityRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), context); + return this; + } + + SecurityRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityRuleInner(); + this.serviceManager = serviceManager; + this.securityRuleName = name; + } + + public SecurityRuleImpl update() { + return this; + } + + public SecurityRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), Context.NONE); + return this; + } + + public SecurityRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .createOrUpdate( + resourceGroupName, networkSecurityGroupName, securityRuleName, this.innerModel(), context); + return this; + } + + SecurityRuleImpl( + SecurityRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName = Utils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + this.securityRuleName = Utils.getValueFromIdByName(innerObject.id(), "securityRules"); + } + + public SecurityRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE) + .getValue(); + return this; + } + + public SecurityRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecurityRules() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context) + .getValue(); + return this; + } + + public SecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SecurityRuleImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SecurityRuleImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityRuleImpl withProtocol(SecurityRuleProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public SecurityRuleImpl withSourcePortRange(String sourcePortRange) { + this.innerModel().withSourcePortRange(sourcePortRange); + return this; + } + + public SecurityRuleImpl withDestinationPortRange(String destinationPortRange) { + this.innerModel().withDestinationPortRange(destinationPortRange); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefix(String sourceAddressPrefix) { + this.innerModel().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + public SecurityRuleImpl withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.innerModel().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + public SecurityRuleImpl withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups) { + this.innerModel().withSourceApplicationSecurityGroups(sourceApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefix(String destinationAddressPrefix) { + this.innerModel().withDestinationAddressPrefix(destinationAddressPrefix); + return this; + } + + public SecurityRuleImpl withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.innerModel().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + public SecurityRuleImpl withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups) { + this.innerModel().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + public SecurityRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public SecurityRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public SecurityRuleImpl withAccess(SecurityRuleAccess access) { + this.innerModel().withAccess(access); + return this; + } + + public SecurityRuleImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public SecurityRuleImpl withDirection(SecurityRuleDirection direction) { + this.innerModel().withDirection(direction); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java new file mode 100644 index 0000000000000..12da5ae363c97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java @@ -0,0 +1,1182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRuleListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecurityRulesClient. */ +public final class SecurityRulesClientImpl implements SecurityRulesClient { + private final ClientLogger logger = new ClientLogger(SecurityRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecurityRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(SecurityRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityRules to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SecurityRulesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @PathParam("securityRuleName") String securityRuleName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecurityRuleInner securityRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkSecurityGroups/{networkSecurityGroupName}/securityRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkSecurityGroupName") String networkSecurityGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).getSyncPoller(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, context).getSyncPoller(); + } + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).block(); + } + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + securityRuleName, + apiVersion, + this.client.getSubscriptionId(), + securityRuleParameters, + accept, + context); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @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 network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @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 network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, + String networkSecurityGroupName, + String securityRuleName, + SecurityRuleInner securityRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create or update network security rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network security rule 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkSecurityGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkSecurityGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkSecurityGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName)); + } + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkSecurityGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityRule API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..cf8aea4c4cdbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityRule; +import com.azure.resourcemanager.network.generated.models.SecurityRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecurityRulesImpl implements SecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRulesImpl.class); + + private final SecurityRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityRulesImpl( + SecurityRulesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, securityRuleName); + } + + public void delete( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + public SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + SecurityRuleInner inner = + this.serviceClient().get(resourceGroupName, networkSecurityGroupName, securityRuleName); + if (inner != null) { + return new SecurityRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecurityRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkSecurityGroupName); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkSecurityGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkSecurityGroupName, context); + return Utils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = Utils.getValueFromIdByName(id, "networkSecurityGroups"); + if (networkSecurityGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkSecurityGroups'.", + id))); + } + String securityRuleName = Utils.getValueFromIdByName(id, "securityRules"); + if (securityRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'securityRules'.", id))); + } + this.delete(resourceGroupName, networkSecurityGroupName, securityRuleName, context); + } + + private SecurityRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityRuleImpl define(String name) { + return new SecurityRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java new file mode 100644 index 0000000000000..b8a37261c5b3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceAssociationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceAssociationLinksClient. */ +public final class ServiceAssociationLinksClientImpl implements ServiceAssociationLinksClient { + private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceAssociationLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceAssociationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceAssociationLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ServiceAssociationLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceAssociationLinks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceAssociationLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceAssociationLinksListResultInner list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return listAsync(resourceGroupName, virtualNetworkName, subnetName).block(); + } + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet 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(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java new file mode 100644 index 0000000000000..59b83b2a37eee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceAssociationLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinks; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinksListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceAssociationLinksImpl implements ServiceAssociationLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLinksImpl.class); + + private final ServiceAssociationLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceAssociationLinksImpl( + ServiceAssociationLinksClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServiceAssociationLinksListResult list( + String resourceGroupName, String virtualNetworkName, String subnetName) { + ServiceAssociationLinksListResultInner inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new ServiceAssociationLinksListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, virtualNetworkName, subnetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceAssociationLinksListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceAssociationLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java new file mode 100644 index 0000000000000..170b0a048509b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLinksListResult; +import java.util.Collections; +import java.util.List; + +public final class ServiceAssociationLinksListResultImpl implements ServiceAssociationLinksListResult { + private ServiceAssociationLinksListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceAssociationLinksListResultImpl( + ServiceAssociationLinksListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ServiceAssociationLinksListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java new file mode 100644 index 0000000000000..b49ef5bc7dc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java @@ -0,0 +1,1537 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyListResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceEndpointPoliciesClient. */ +public final class ServiceEndpointPoliciesClientImpl implements ServiceEndpointPoliciesClient { + private final ClientLogger logger = new ClientLogger(ServiceEndpointPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceEndpointPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceEndpointPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(ServiceEndpointPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceEndpointPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceEndpointPoliciesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceEndpointPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName).getSyncPoller(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, context).getSyncPoller(); + } + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, expand).block(); + } + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + ServiceEndpointPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a service Endpoint Policies. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to the create or update service endpoint policy operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyInner updateTags( + String resourceGroupName, String serviceEndpointPolicyName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, serviceEndpointPolicyName, parameters).block(); + } + + /** + * Updates tags of a service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param parameters Parameters supplied to update service endpoint policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service End point policy resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListServiceEndpointPolicies API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..c62f619ec2bb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicies; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceEndpointPoliciesImpl implements ServiceEndpointPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPoliciesImpl.class); + + private final ServiceEndpointPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceEndpointPoliciesImpl( + ServiceEndpointPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName); + } + + public void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName, context); + } + + public ServiceEndpointPolicy getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName) { + ServiceEndpointPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, serviceEndpointPolicyName); + if (inner != null) { + return new ServiceEndpointPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceEndpointPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = Utils.getValueFromIdByName(id, "serviceEndpointPolicies"); + if (serviceEndpointPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicies'.", + id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, context); + } + + private ServiceEndpointPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ServiceEndpointPolicyImpl define(String name) { + return new ServiceEndpointPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java new file mode 100644 index 0000000000000..9d563338b7213 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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..1c414d9297423 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPolicyDefinitionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServiceEndpointPolicyDefinitionsClient. + */ +public final class ServiceEndpointPolicyDefinitionsClientImpl implements ServiceEndpointPolicyDefinitionsClient { + private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceEndpointPolicyDefinitionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceEndpointPolicyDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceEndpointPolicyDefinitionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + ServiceEndpointPolicyDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceEndpointPolicyDefinitions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceEndpointPolicyDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions" + + "/{serviceEndpointPolicyDefinitionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @PathParam("serviceEndpointPolicyDefinitionName") String serviceEndpointPolicyDefinitionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceEndpointPolicyName") String serviceEndpointPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return beginDeleteAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .getSyncPoller(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceEndpointPolicyDefinitionInner get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).block(); + } + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + apiVersion, + this.client.getSubscriptionId(), + serviceEndpointPolicyDefinitions, + accept, + context); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions) + .getSyncPoller(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceEndpointPolicyName, + serviceEndpointPolicyDefinitionName, + serviceEndpointPolicyDefinitions, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a service endpoint policy definition in the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param serviceEndpointPolicyDefinitions Parameters supplied to the create or update service endpoint policy + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Endpoint policy definitions 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceEndpointPolicyName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, serviceEndpointPolicyName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName)); + } + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListServiceEndpointPolicyDefinition API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..44f23932d791c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceEndpointPolicyDefinitionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinition; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicyDefinitions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceEndpointPolicyDefinitionsImpl implements ServiceEndpointPolicyDefinitions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionsImpl.class); + + private final ServiceEndpointPolicyDefinitionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceEndpointPolicyDefinitionsImpl( + ServiceEndpointPolicyDefinitionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + this.serviceClient().delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); + } + + public void delete( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + } + + public ServiceEndpointPolicyDefinition get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + ServiceEndpointPolicyDefinitionInner inner = + this.serviceClient().get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName); + if (inner != null) { + return new ServiceEndpointPolicyDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceEndpointPolicyDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public 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..5e6973a228527 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.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.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 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..94698ca63b9f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.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 { + private final ClientLogger logger = new ClientLogger(ServiceTagInformationsClientImpl.class); + + /** 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") + private 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 = "2021-08-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 = "2021-08-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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..48e082866adb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceTagInformationsImpl implements ServiceTagInformations { + @JsonIgnore private 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..2240d498dbc97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceTagsClient. */ +public final class ServiceTagsClientImpl implements ServiceTagsClient { + private final ClientLogger logger = new ClientLogger(ServiceTagsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceTagsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceTagsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTagsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(ServiceTagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceTags to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface ServiceTagsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceTagsListResultInner list(String location) { + return listAsync(location).block(); + } + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String location, Context context) { + return listWithResponseAsync(location, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java new file mode 100644 index 0000000000000..6a8238f5b955f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import com.azure.resourcemanager.network.generated.models.ServiceTags; +import com.azure.resourcemanager.network.generated.models.ServiceTagsListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceTagsImpl implements ServiceTags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagsImpl.class); + + private final ServiceTagsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceTagsImpl( + ServiceTagsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServiceTagsListResult list(String location) { + ServiceTagsListResultInner inner = this.serviceClient().list(location); + if (inner != null) { + return new ServiceTagsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String location, Context context) { + Response inner = this.serviceClient().listWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceTagsListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceTagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.java new file mode 100644 index 0000000000000..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/SubnetImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java new file mode 100644 index 0000000000000..aaf2e58694b58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.IpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfile; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import com.azure.resourcemanager.network.generated.models.RouteTable; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SubnetImpl implements Subnet, Subnet.Definition, Subnet.Update { + private SubnetInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public List addressPrefixes() { + List inner = this.innerModel().addressPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkSecurityGroup networkSecurityGroup() { + NetworkSecurityGroupInner inner = this.innerModel().networkSecurityGroup(); + if (inner != null) { + return new NetworkSecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public RouteTable routeTable() { + RouteTableInner inner = this.innerModel().routeTable(); + if (inner != null) { + return new RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubResource natGateway() { + return this.innerModel().natGateway(); + } + + public List serviceEndpoints() { + List inner = this.innerModel().serviceEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceEndpointPolicies() { + List inner = this.innerModel().serviceEndpointPolicies(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpoints() { + List inner = this.innerModel().privateEndpoints(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipConfigurationProfiles() { + List inner = this.innerModel().ipConfigurationProfiles(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new IpConfigurationProfileImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List ipAllocations() { + List inner = this.innerModel().ipAllocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List resourceNavigationLinks() { + List inner = this.innerModel().resourceNavigationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceAssociationLinks() { + List inner = this.innerModel().serviceAssociationLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List delegations() { + List inner = this.innerModel().delegations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String purpose() { + return this.innerModel().purpose(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies() { + return this.innerModel().privateEndpointNetworkPolicies(); + } + + public VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies() { + return this.innerModel().privateLinkServiceNetworkPolicies(); + } + + public List applicationGatewayIpConfigurations() { + List inner = this.innerModel().applicationGatewayIpConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SubnetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private String subnetName; + + public SubnetImpl withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkName = virtualNetworkName; + return this; + } + + public Subnet create() { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), Context.NONE); + return this; + } + + public Subnet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), context); + return this; + } + + SubnetImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SubnetInner(); + this.serviceManager = serviceManager; + this.subnetName = name; + } + + public SubnetImpl update() { + return this; + } + + public Subnet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), Context.NONE); + return this; + } + + public Subnet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, this.innerModel(), context); + return this; + } + + SubnetImpl(SubnetInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.subnetName = Utils.getValueFromIdByName(innerObject.id(), "subnets"); + } + + public Subnet refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public Subnet refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getSubnets() + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, context) + .getValue(); + return this; + } + + public void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + } + + public void prepareNetworkPolicies( + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + } + + public void unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + } + + public void unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context) { + serviceManager + .subnets() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + } + + public SubnetImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public SubnetImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public SubnetImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public SubnetImpl withAddressPrefixes(List addressPrefixes) { + this.innerModel().withAddressPrefixes(addressPrefixes); + return this; + } + + public SubnetImpl withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup) { + this.innerModel().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + public SubnetImpl withRouteTable(RouteTableInner routeTable) { + this.innerModel().withRouteTable(routeTable); + return this; + } + + public SubnetImpl withNatGateway(SubResource natGateway) { + this.innerModel().withNatGateway(natGateway); + return this; + } + + public SubnetImpl withServiceEndpoints(List serviceEndpoints) { + this.innerModel().withServiceEndpoints(serviceEndpoints); + return this; + } + + public SubnetImpl withServiceEndpointPolicies(List serviceEndpointPolicies) { + this.innerModel().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + public SubnetImpl withIpAllocations(List ipAllocations) { + this.innerModel().withIpAllocations(ipAllocations); + return this; + } + + public SubnetImpl withDelegations(List delegations) { + this.innerModel().withDelegations(delegations); + return this; + } + + public SubnetImpl withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies) { + this.innerModel().withPrivateEndpointNetworkPolicies(privateEndpointNetworkPolicies); + return this; + } + + public SubnetImpl withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies) { + this.innerModel().withPrivateLinkServiceNetworkPolicies(privateLinkServiceNetworkPolicies); + return this; + } + + public SubnetImpl withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations) { + this.innerModel().withApplicationGatewayIpConfigurations(applicationGatewayIpConfigurations); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/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..79b5395431c37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java @@ -0,0 +1,1902 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.SubnetListResult; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SubnetsClient. */ +public final class SubnetsClientImpl implements SubnetsClient { + private final ClientLogger logger = new ClientLogger(SubnetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SubnetsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubnetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubnetsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SubnetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSubnets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface SubnetsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SubnetInner subnetParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> prepareNetworkPolicies( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> unprepareNetworkPolicies( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("subnetName") String subnetName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/subnets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).getSyncPoller(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName, context).getSyncPoller(); + } + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) { + final String expand = null; + return getAsync(resourceGroupName, virtualNetworkName, subnetName, expand).block(); + } + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + subnetName, + apiVersion, + this.client.getSubscriptionId(), + subnetParameters, + accept, + context); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters) + .getSyncPoller(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubnetInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + SubnetInner subnetParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create or update subnet operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subnet in a virtual network resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) + .getSyncPoller(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPrepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + return beginPrepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context) + .getSyncPoller(); + } + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) + .getSyncPoller(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUnprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + return beginUnprepareNetworkPoliciesAsync( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context) + .getSyncPoller(); + } + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..d5d55b569af9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.Subnets; +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SubnetsImpl implements Subnets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetsImpl.class); + + private final SubnetsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SubnetsImpl( + SubnetsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + public Subnet get(String resourceGroupName, String virtualNetworkName, String subnetName) { + SubnetInner inner = this.serviceClient().get(resourceGroupName, virtualNetworkName, subnetName); + if (inner != null) { + return new SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubnetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + this + .serviceClient() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters); + } + + public void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context) { + this + .serviceClient() + .prepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters, context); + } + + public void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + this + .serviceClient() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters); + } + + public void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context) { + this + .serviceClient() + .unprepareNetworkPolicies( + resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters, context); + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public Subnet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + String localExpand = null; + return this + .getWithResponse(resourceGroupName, virtualNetworkName, subnetName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String subnetName = Utils.getValueFromIdByName(id, "subnets"); + if (subnetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'subnets'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, subnetName, context); + } + + private SubnetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SubnetImpl define(String name) { + return new SubnetImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java new file mode 100644 index 0000000000000..4e250a2aa2734 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TopologyImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import com.azure.resourcemanager.network.generated.models.Topology; +import com.azure.resourcemanager.network.generated.models.TopologyResource; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TopologyImpl implements Topology { + private TopologyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + TopologyImpl(TopologyInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime lastModified() { + return this.innerModel().lastModified(); + } + + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TopologyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java new file mode 100644 index 0000000000000..2a88ed09cbf7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import com.azure.resourcemanager.network.generated.models.TroubleshootingResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TroubleshootingResultImpl implements TroubleshootingResult { + private TroubleshootingResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + TroubleshootingResultImpl( + TroubleshootingResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public String code() { + return this.innerModel().code(); + } + + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TroubleshootingResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..4ecca678e41e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.Usage; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public long currentValue() { + return this.innerModel().currentValue(); + } + + public long limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..6f05ce1baf631 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.UsagesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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..a92bfb64b52ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.network.generated.models.Usage; +import com.azure.resourcemanager.network.generated.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java new file mode 100644 index 0000000000000..64d0a08514764 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java new file mode 100644 index 0000000000000..53cdfa059d67b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowResult; + +public final class VerificationIpFlowResultImpl implements VerificationIpFlowResult { + private VerificationIpFlowResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VerificationIpFlowResultImpl( + VerificationIpFlowResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Access access() { + return this.innerModel().access(); + } + + public String ruleName() { + return this.innerModel().ruleName(); + } + + public VerificationIpFlowResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java new file mode 100644 index 0000000000000..0c2ac92701e74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSite; + +public final class VirtualApplianceSiteImpl + implements VirtualApplianceSite, VirtualApplianceSite.Definition, VirtualApplianceSite.Update { + private VirtualApplianceSiteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public Office365PolicyProperties o365Policy() { + return this.innerModel().o365Policy(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualApplianceSiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkVirtualApplianceName; + + private String siteName; + + public VirtualApplianceSiteImpl withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName) { + this.resourceGroupName = resourceGroupName; + this.networkVirtualApplianceName = networkVirtualApplianceName; + return this; + } + + public VirtualApplianceSite create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualApplianceSite create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), context); + return this; + } + + VirtualApplianceSiteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualApplianceSiteInner(); + this.serviceManager = serviceManager; + this.siteName = name; + } + + public VirtualApplianceSiteImpl update() { + return this; + } + + public VirtualApplianceSite apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate( + resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualApplianceSite apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, siteName, this.innerModel(), context); + return this; + } + + VirtualApplianceSiteImpl( + VirtualApplianceSiteInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName = Utils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.siteName = Utils.getValueFromIdByName(innerObject.id(), "virtualApplianceSites"); + } + + public VirtualApplianceSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE) + .getValue(); + return this; + } + + public VirtualApplianceSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualApplianceSites() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context) + .getValue(); + return this; + } + + public VirtualApplianceSiteImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualApplianceSiteImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public VirtualApplianceSiteImpl withO365Policy(Office365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java new file mode 100644 index 0000000000000..8cc86e1074344 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java @@ -0,0 +1,1180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSiteListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSitesClient. */ +public final class VirtualApplianceSitesClientImpl implements VirtualApplianceSitesClient { + private final ClientLogger logger = new ClientLogger(VirtualApplianceSitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualApplianceSitesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualApplianceSitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualApplianceSitesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualApplianceSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualApplianceSites to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualApplianceSitesService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("siteName") String siteName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualApplianceSiteInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName).getSyncPoller(); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, siteName, context).getSyncPoller(); + } + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualApplianceSiteInner get( + String resourceGroupName, String networkVirtualApplianceName, String siteName) { + return getAsync(resourceGroupName, networkVirtualApplianceName, siteName).block(); + } + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + siteName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, + String networkVirtualApplianceName, + String siteName, + VirtualApplianceSiteInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, siteName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Network Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param parameters Parameters supplied to the create or update Network Virtual Appliance Site operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + networkVirtualApplianceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkVirtualApplianceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkVirtualApplianceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkVirtualApplianceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkVirtualApplianceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkVirtualApplianceName)); + } + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkVirtualApplianceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..067377ee3733a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSite; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualApplianceSitesImpl implements VirtualApplianceSites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSitesImpl.class); + + private final VirtualApplianceSitesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualApplianceSitesImpl( + VirtualApplianceSitesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, siteName); + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + public VirtualApplianceSite get(String resourceGroupName, String networkVirtualApplianceName, String siteName) { + VirtualApplianceSiteInner inner = + this.serviceClient().get(resourceGroupName, networkVirtualApplianceName, siteName); + if (inner != null) { + return new VirtualApplianceSiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualApplianceSiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String networkVirtualApplianceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkVirtualApplianceName); + return Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, networkVirtualApplianceName, context); + return Utils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public VirtualApplianceSite getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = Utils.getValueFromIdByName(id, "networkVirtualAppliances"); + if (networkVirtualApplianceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'networkVirtualAppliances'.", + id))); + } + String siteName = Utils.getValueFromIdByName(id, "virtualApplianceSites"); + if (siteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualApplianceSites'.", + id))); + } + this.delete(resourceGroupName, networkVirtualApplianceName, siteName, context); + } + + private VirtualApplianceSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualApplianceSiteImpl define(String name) { + return new VirtualApplianceSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java new file mode 100644 index 0000000000000..ee640a4b3efaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualApplianceSkusClient. */ +public final class VirtualApplianceSkusClientImpl implements VirtualApplianceSkusClient { + private final ClientLogger logger = new ClientLogger(VirtualApplianceSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualApplianceSkusService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualApplianceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualApplianceSkusClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualApplianceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualApplianceSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualApplianceSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("skuName") String skuName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceSkuInner get(String skuName) { + return getAsync(skuName).block(); + } + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String skuName, Context context) { + return getWithResponseAsync(skuName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..8b0393f7bf0fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualApplianceSkusClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSku; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualApplianceSkusImpl implements VirtualApplianceSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSkusImpl.class); + + private final VirtualApplianceSkusClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualApplianceSkusImpl( + VirtualApplianceSkusClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public NetworkVirtualApplianceSku get(String skuName) { + NetworkVirtualApplianceSkuInner inner = this.serviceClient().get(skuName); + if (inner != null) { + return new NetworkVirtualApplianceSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String skuName, Context context) { + Response inner = this.serviceClient().getWithResponse(skuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkVirtualApplianceSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VirtualApplianceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java new file mode 100644 index 0000000000000..bb33b0891ae0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java @@ -0,0 +1,1685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubBgpConnectionResults; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubBgpConnectionsClient. */ +public final class VirtualHubBgpConnectionsClientImpl implements VirtualHubBgpConnectionsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubBgpConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubBgpConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubBgpConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubBgpConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualHubBgpConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubBgpConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubBgpConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BgpConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/bgpConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{hubName}/bgpConnections/{connectionName}/learnedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listLearnedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hubName") String hubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{hubName}/bgpConnections/{connectionName}/advertisedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listAdvertisedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hubName") String hubName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpConnectionInner get(String resourceGroupName, String virtualHubName, String connectionName) { + return getAsync(resourceGroupName, virtualHubName, connectionName).block(); + } + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + connectionName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String connectionName, BgpConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters).getSyncPoller(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + BgpConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, connectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param parameters Parameters of Bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String connectionName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> beginListLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListLearnedRoutesAsync(resourceGroupName, hubName, connectionName, context).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + hubName, + connectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @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 list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PeerRouteListInner> beginListAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + return beginListAdvertisedRoutesAsync(resourceGroupName, hubName, connectionName, context).getSyncPoller(); + } + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..721cdbceedabd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import com.azure.resourcemanager.network.generated.models.BgpConnection; +import com.azure.resourcemanager.network.generated.models.PeerRouteList; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubBgpConnectionsImpl implements VirtualHubBgpConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubBgpConnectionsImpl.class); + + private final VirtualHubBgpConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubBgpConnectionsImpl( + VirtualHubBgpConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BgpConnection get(String resourceGroupName, String virtualHubName, String connectionName) { + BgpConnectionInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, connectionName); + if (inner != null) { + return new BgpConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BgpConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName); + } + + public void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, connectionName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listLearnedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context) { + PeerRouteListInner inner = + this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return new PeerRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String connectionName = Utils.getValueFromIdByName(id, "bgpConnections"); + if (connectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'bgpConnections'.", id))); + } + this.delete(resourceGroupName, virtualHubName, connectionName, context); + } + + private VirtualHubBgpConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public BgpConnectionImpl define(String name) { + return new BgpConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java new file mode 100644 index 0000000000000..47e3db334475c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.PreferredRoutingGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualHubImpl implements VirtualHub, VirtualHub.Definition, VirtualHub.Update { + private VirtualHubInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualHubInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private TagsObject updateVirtualHubParameters; + + public VirtualHubImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualHub create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .createOrUpdate(resourceGroupName, virtualHubName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualHub create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .createOrUpdate(resourceGroupName, virtualHubName, this.innerModel(), context); + return this; + } + + VirtualHubImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualHubInner(); + this.serviceManager = serviceManager; + this.virtualHubName = name; + } + + public VirtualHubImpl update() { + this.updateVirtualHubParameters = new TagsObject(); + return this; + } + + public VirtualHub apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .updateTagsWithResponse(resourceGroupName, virtualHubName, updateVirtualHubParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualHub apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .updateTagsWithResponse(resourceGroupName, virtualHubName, updateVirtualHubParameters, context) + .getValue(); + return this; + } + + VirtualHubImpl( + VirtualHubInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = Utils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + } + + public VirtualHub refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE) + .getValue(); + return this; + } + + public VirtualHub refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualHubs() + .getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context) + .getValue(); + return this; + } + + public void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters) { + serviceManager + .virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters); + } + + public void getEffectiveVirtualHubRoutes() { + serviceManager.virtualHubs().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + serviceManager + .virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public VirtualHubImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualHubImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualHubImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualHubParameters.withTags(tags); + return this; + } + } + + public VirtualHubImpl withVirtualWan(SubResource virtualWan) { + this.innerModel().withVirtualWan(virtualWan); + return this; + } + + public VirtualHubImpl withVpnGateway(SubResource vpnGateway) { + this.innerModel().withVpnGateway(vpnGateway); + return this; + } + + public VirtualHubImpl withP2SVpnGateway(SubResource p2SVpnGateway) { + this.innerModel().withP2SVpnGateway(p2SVpnGateway); + return this; + } + + public VirtualHubImpl withExpressRouteGateway(SubResource expressRouteGateway) { + this.innerModel().withExpressRouteGateway(expressRouteGateway); + return this; + } + + public VirtualHubImpl withAzureFirewall(SubResource azureFirewall) { + this.innerModel().withAzureFirewall(azureFirewall); + return this; + } + + public VirtualHubImpl withSecurityPartnerProvider(SubResource securityPartnerProvider) { + this.innerModel().withSecurityPartnerProvider(securityPartnerProvider); + return this; + } + + public VirtualHubImpl withAddressPrefix(String addressPrefix) { + this.innerModel().withAddressPrefix(addressPrefix); + return this; + } + + public VirtualHubImpl withRouteTable(VirtualHubRouteTable routeTable) { + this.innerModel().withRouteTable(routeTable); + return this; + } + + public VirtualHubImpl withSecurityProviderName(String securityProviderName) { + this.innerModel().withSecurityProviderName(securityProviderName); + return this; + } + + public VirtualHubImpl withVirtualHubRouteTableV2S(List virtualHubRouteTableV2S) { + this.innerModel().withVirtualHubRouteTableV2S(virtualHubRouteTableV2S); + return this; + } + + public VirtualHubImpl withSku(String sku) { + this.innerModel().withSku(sku); + return this; + } + + public VirtualHubImpl withVirtualRouterAsn(Long virtualRouterAsn) { + this.innerModel().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + public VirtualHubImpl withVirtualRouterIps(List virtualRouterIps) { + this.innerModel().withVirtualRouterIps(virtualRouterIps); + return this; + } + + public VirtualHubImpl withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic) { + this.innerModel().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + public VirtualHubImpl withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway) { + this.innerModel().withPreferredRoutingGateway(preferredRoutingGateway); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java new file mode 100644 index 0000000000000..2962dc81e9441 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java @@ -0,0 +1,1145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubIpConfigurationResults; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubIpConfigurationsClient. */ +public final class VirtualHubIpConfigurationsClientImpl implements VirtualHubIpConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubIpConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubIpConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubIpConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubIpConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualHubIpConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubIpConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubIpConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HubIpConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations/{ipConfigName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("ipConfigName") String ipConfigName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/ipConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HubIpConfigurationInner get(String resourceGroupName, String virtualHubName, String ipConfigName) { + return getAsync(resourceGroupName, virtualHubName, ipConfigName).block(); + } + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + ipConfigName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @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 ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters).getSyncPoller(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String ipConfigName, + HubIpConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, ipConfigName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing + * VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param parameters Hub Ip Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String ipConfigName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, ipConfigName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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..ca2f9f87290f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubIpConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.HubIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualHubIpConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubIpConfigurationsImpl implements VirtualHubIpConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubIpConfigurationsImpl.class); + + private final VirtualHubIpConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubIpConfigurationsImpl( + VirtualHubIpConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public HubIpConfiguration get(String resourceGroupName, String virtualHubName, String ipConfigName) { + HubIpConfigurationInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, ipConfigName); + if (inner != null) { + return new HubIpConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HubIpConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String ipConfigName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, ipConfigName); + } + + public void delete(String resourceGroupName, String virtualHubName, String ipConfigName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, ipConfigName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public HubIpConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, ipConfigName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + String ipConfigName = Utils.getValueFromIdByName(id, "ipConfigurations"); + if (ipConfigName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'ipConfigurations'.", id))); + } + this.delete(resourceGroupName, virtualHubName, ipConfigName, context); + } + + private VirtualHubIpConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public HubIpConfigurationImpl define(String name) { + return new HubIpConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java new file mode 100644 index 0000000000000..8c062ebf18af4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.util.Collections; +import java.util.List; + +public final class VirtualHubRouteTableV2Impl implements VirtualHubRouteTableV2 { + private VirtualHubRouteTableV2Inner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualHubRouteTableV2Impl( + VirtualHubRouteTableV2Inner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List routes() { + List inner = this.innerModel().routes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List attachedConnections() { + List inner = this.innerModel().attachedConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualHubRouteTableV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java new file mode 100644 index 0000000000000..a7234692ddd43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java @@ -0,0 +1,1166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubRouteTableV2SResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubRouteTableV2SClient. */ +public final class VirtualHubRouteTableV2SClientImpl implements VirtualHubRouteTableV2SClient { + private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2SClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubRouteTableV2SService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubRouteTableV2SClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubRouteTableV2SClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualHubRouteTableV2SService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubRouteTableV2S to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubRouteTableV2SService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables/{routeTableName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routeTableName") String routeTableName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/routeTables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubRouteTableV2Inner get(String resourceGroupName, String virtualHubName, String routeTableName) { + return getAsync(resourceGroupName, virtualHubName, routeTableName).block(); + } + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + routeTableName, + apiVersion, + virtualHubRouteTableV2Parameters, + accept, + context); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routeTableName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName).getSyncPoller(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeTableName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..b91dc66c60eef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubRouteTableV2SClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2S; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubRouteTableV2SImpl implements VirtualHubRouteTableV2S { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTableV2SImpl.class); + + private final VirtualHubRouteTableV2SClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubRouteTableV2SImpl( + VirtualHubRouteTableV2SClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualHubRouteTableV2 get(String resourceGroupName, String virtualHubName, String routeTableName) { + VirtualHubRouteTableV2Inner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routeTableName); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routeTableName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualHubRouteTableV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + VirtualHubRouteTableV2Inner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context) { + VirtualHubRouteTableV2Inner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters, context); + if (inner != null) { + return new VirtualHubRouteTableV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeTableName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualHubName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubRouteTableV2Impl(inner1, this.manager())); + } + + private VirtualHubRouteTableV2SClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java new file mode 100644 index 0000000000000..1c7bd39221292 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java @@ -0,0 +1,1793 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubsResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualHubsClient. */ +public final class VirtualHubsClientImpl implements VirtualHubsClient { + private final ClientLogger logger = new ClientLogger(VirtualHubsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualHubsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualHubsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualHubsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualHubs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualHubsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualHubInner virtualHubParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject virtualHubParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualHubs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" + + "/{virtualHubName}/effectiveRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getEffectiveVirtualHubRoutes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EffectiveRoutesParameters effectiveRoutesParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner getByResourceGroup(String resourceGroupName, String virtualHubName) { + return getByResourceGroupAsync(resourceGroupName, virtualHubName).block(); + } + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName, context).block(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + virtualHubParameters, + accept, + context); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters).getSyncPoller(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, virtualHubParameters, context) + .getSyncPoller(); + } + + /** + * Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to create or update VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubInner updateTags( + String resourceGroupName, String virtualHubName, TagsObject virtualHubParameters) { + return updateTagsAsync(resourceGroupName, virtualHubName, virtualHubParameters).block(); + } + + /** + * Updates VirtualHub tags. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param virtualHubParameters Parameters supplied to update VirtualHub tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName) { + return beginDeleteAsync(resourceGroupName, virtualHubName).getSyncPoller(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualHubName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEffectiveVirtualHubRoutes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualHubName, + apiVersion, + effectiveRoutesParameters, + accept, + context); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + return beginGetEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters) + .getSyncPoller(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGetEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + return beginGetEffectiveVirtualHubRoutesAsync( + resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .getSyncPoller(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the effective routes configured for the Virtual Hub resource or the specified resource 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. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).block(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters).block(); + } + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..1f4eb3edbfc1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import com.azure.resourcemanager.network.generated.models.VirtualHubs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualHubsImpl implements VirtualHubs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubsImpl.class); + + private final VirtualHubsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualHubsImpl( + VirtualHubsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualHub getByResourceGroup(String resourceGroupName, String virtualHubName) { + VirtualHubInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualHubName); + if (inner != null) { + return new VirtualHubImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualHubImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualHubName) { + this.serviceClient().delete(resourceGroupName, virtualHubName); + } + + public void delete(String resourceGroupName, String virtualHubName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters) { + this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters); + } + + public void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context) { + this + .serviceClient() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public VirtualHub getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualHubName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = Utils.getValueFromIdByName(id, "virtualHubs"); + if (virtualHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualHubs'.", id))); + } + this.delete(resourceGroupName, virtualHubName, context); + } + + private VirtualHubsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualHubImpl define(String name) { + return new VirtualHubImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java new file mode 100644 index 0000000000000..7bd74a4dfad1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionImpl.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualNetworkGatewayConnectionImpl + implements VirtualNetworkGatewayConnection, + VirtualNetworkGatewayConnection.Definition, + VirtualNetworkGatewayConnection.Update { + private VirtualNetworkGatewayConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkGatewayConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayConnectionName; + + private TagsObject updateParameters; + + public VirtualNetworkGatewayConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworkGatewayConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayConnectionImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayConnectionInner(); + this.serviceManager = serviceManager; + this.virtualNetworkGatewayConnectionName = name; + } + + public VirtualNetworkGatewayConnectionImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetworkGatewayConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, updateParameters, Context.NONE); + return this; + } + + public VirtualNetworkGatewayConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, updateParameters, context); + return this; + } + + VirtualNetworkGatewayConnectionImpl( + VirtualNetworkGatewayConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public VirtualNetworkGatewayConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayConnections() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .getValue(); + return this; + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters) { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String startPacketCapture() { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters) { + return serviceManager + .virtualNetworkGatewayConnections() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String getIkeSas() { + return serviceManager + .virtualNetworkGatewayConnections() + .getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String getIkeSas(Context context) { + return serviceManager + .virtualNetworkGatewayConnections() + .getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void resetConnection() { + serviceManager + .virtualNetworkGatewayConnections() + .resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void resetConnection(Context context) { + serviceManager + .virtualNetworkGatewayConnections() + .resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public VirtualNetworkGatewayConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway1( + VirtualNetworkGatewayInner virtualNetworkGateway1) { + this.innerModel().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionType(VirtualNetworkGatewayConnectionType connectionType) { + this.innerModel().withConnectionType(connectionType); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkGatewayConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withVirtualNetworkGateway2( + VirtualNetworkGatewayInner virtualNetworkGateway2) { + this.innerModel().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2) { + this.innerModel().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withIngressNatRules(List ingressNatRules) { + this.innerModel().withIngressNatRules(ingressNatRules); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withEgressNatRules(List egressNatRules) { + this.innerModel().withEgressNatRules(egressNatRules); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionProtocol( + VirtualNetworkGatewayConnectionProtocol connectionProtocol) { + this.innerModel().withConnectionProtocol(connectionProtocol); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withRoutingWeight(Integer routingWeight) { + this.innerModel().withRoutingWeight(routingWeight); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + this.innerModel().withDpdTimeoutSeconds(dpdTimeoutSeconds); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withConnectionMode(VirtualNetworkGatewayConnectionMode connectionMode) { + this.innerModel().withConnectionMode(connectionMode); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withSharedKey(String sharedKey) { + this.innerModel().withSharedKey(sharedKey); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withPeer(SubResource peer) { + this.innerModel().withPeer(peer); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withEnableBgp(Boolean enableBgp) { + this.innerModel().withEnableBgp(enableBgp); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress) { + this.innerModel().withUseLocalAzureIpAddress(useLocalAzureIpAddress); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withUsePolicyBasedTrafficSelectors( + Boolean usePolicyBasedTrafficSelectors) { + this.innerModel().withUsePolicyBasedTrafficSelectors(usePolicyBasedTrafficSelectors); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withIpsecPolicies(List ipsecPolicies) { + this.innerModel().withIpsecPolicies(ipsecPolicies); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withTrafficSelectorPolicies( + List trafficSelectorPolicies) { + this.innerModel().withTrafficSelectorPolicies(trafficSelectorPolicies); + return this; + } + + public VirtualNetworkGatewayConnectionImpl withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.innerModel().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java new file mode 100644 index 0000000000000..238be7083ca8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkConnectionGatewayReference; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListEntity; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualNetworkGatewayConnectionListEntityImpl implements VirtualNetworkGatewayConnectionListEntity { + private VirtualNetworkGatewayConnectionListEntityInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkGatewayConnectionListEntityImpl( + VirtualNetworkGatewayConnectionListEntityInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 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 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..df9017d263e5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionPropertiesFormatImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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.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 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 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..fc3303787f182 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java @@ -0,0 +1,3515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListResult; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VirtualNetworkGatewayConnectionsClient. + */ +public final class VirtualNetworkGatewayConnectionsClientImpl implements VirtualNetworkGatewayConnectionsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewayConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewayConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualNetworkGatewayConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGatewayConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewayConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkGatewayConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectionSharedKeyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/sharedkey/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ConnectionResetSharedKeyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/startPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/stopPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/getikesas") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getIkeSas( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/resetconnection") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetConnection( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the create or update virtual network gateway connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayConnectionInner getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .block(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).getSyncPoller(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + TagsObject parameters, + Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a virtual network gateway connection tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to update virtual network gateway connection tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).block(); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).block(); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetSharedKey( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + final VpnPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .block(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getIkeSas( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayConnectionName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginGetIkeSasAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName).getSyncPoller(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return beginResetConnectionAsync(resourceGroupName, virtualNetworkGatewayConnectionName, context) + .getSyncPoller(); + } + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..c608735d2fd67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.models.ConnectionResetSharedKey; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKey; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnections; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewayConnectionsImpl implements VirtualNetworkGatewayConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionsImpl.class); + + private final VirtualNetworkGatewayConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewayConnectionsImpl( + VirtualNetworkGatewayConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGatewayConnection getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName) { + VirtualNetworkGatewayConnectionInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkGatewayConnectionName); + if (inner != null) { + return new VirtualNetworkGatewayConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public ConnectionSharedKey setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + ConnectionSharedKeyInner inner = + this.serviceClient().setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKey setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context) { + ConnectionSharedKeyInner inner = + this + .serviceClient() + .setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKey getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + ConnectionSharedKeyInner inner = + this.serviceClient().getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName); + if (inner != null) { + return new ConnectionSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getSharedKeyWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectionSharedKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + ConnectionResetSharedKeyInner inner = + this.serviceClient().resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context) { + ConnectionResetSharedKeyInner inner = + this + .serviceClient() + .resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + if (inner != null) { + return new ConnectionResetSharedKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + return this.serviceClient().getIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName); + } + + public void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context) { + this.serviceClient().resetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public VirtualNetworkGatewayConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = Utils.getValueFromIdByName(id, "connections"); + if (virtualNetworkGatewayConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayConnectionName, context); + } + + private VirtualNetworkGatewayConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayConnectionImpl define(String name) { + return new VirtualNetworkGatewayConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java new file mode 100644 index 0000000000000..ffd4a85579369 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.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.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayGeneration; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualNetworkGatewayImpl + implements VirtualNetworkGateway, VirtualNetworkGateway.Definition, VirtualNetworkGateway.Update { + private VirtualNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayName; + + private TagsObject updateParameters; + + public VirtualNetworkGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetworkGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayInner(); + this.serviceManager = serviceManager; + this.virtualNetworkGatewayName = name; + } + + public VirtualNetworkGatewayImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetworkGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .updateTags(resourceGroupName, virtualNetworkGatewayName, updateParameters, Context.NONE); + return this; + } + + public VirtualNetworkGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .updateTags(resourceGroupName, virtualNetworkGatewayName, updateParameters, context); + return this; + } + + VirtualNetworkGatewayImpl( + VirtualNetworkGatewayInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + } + + public VirtualNetworkGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGateways() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context) + .getValue(); + return this; + } + + public VirtualNetworkGateway reset(String gatewayVip) { + return serviceManager.virtualNetworkGateways().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + } + + public VirtualNetworkGateway reset() { + return serviceManager.virtualNetworkGateways().reset(resourceGroupName, virtualNetworkGatewayName); + } + + public VirtualNetworkGateway reset(String gatewayVip, Context context) { + return serviceManager + .virtualNetworkGateways() + .reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); + } + + public void resetVpnClientSharedKey() { + serviceManager.virtualNetworkGateways().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName); + } + + public void resetVpnClientSharedKey(Context context) { + serviceManager + .virtualNetworkGateways() + .resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String generatevpnclientpackage(VpnClientParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generatevpnclientpackage(VpnClientParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String generateVpnProfile(VpnClientParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generateVpnProfile(VpnClientParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String getVpnProfilePackageUrl() { + return serviceManager + .virtualNetworkGateways() + .getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName); + } + + public String getVpnProfilePackageUrl(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, context); + } + + public BgpPeerStatusListResult getBgpPeerStatus(String peer) { + return serviceManager + .virtualNetworkGateways() + .getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer); + } + + public BgpPeerStatusListResult getBgpPeerStatus() { + return serviceManager.virtualNetworkGateways().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName); + } + + public BgpPeerStatusListResult getBgpPeerStatus(String peer, Context context) { + return serviceManager + .virtualNetworkGateways() + .getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, context); + } + + public String supportedVpnDevices() { + return serviceManager + .virtualNetworkGateways() + .supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + public Response supportedVpnDevicesWithResponse(Context context) { + return serviceManager + .virtualNetworkGateways() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public GatewayRouteListResult getLearnedRoutes() { + return serviceManager.virtualNetworkGateways().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName); + } + + public GatewayRouteListResult getLearnedRoutes(Context context) { + return serviceManager + .virtualNetworkGateways() + .getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, context); + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters(VpnClientIPsecParametersInner vpnclientIpsecParams) { + return serviceManager + .virtualNetworkGateways() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + VpnClientIPsecParametersInner vpnclientIpsecParams, Context context) { + return serviceManager + .virtualNetworkGateways() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters() { + return serviceManager + .virtualNetworkGateways() + .getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName); + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String startPacketCapture() { + return serviceManager.virtualNetworkGateways().startPacketCapture(resourceGroupName, virtualNetworkGatewayName); + } + + public String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters) { + return serviceManager + .virtualNetworkGateways() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context) { + return serviceManager + .virtualNetworkGateways() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth() { + return serviceManager + .virtualNetworkGateways() + .getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(Context context) { + return serviceManager + .virtualNetworkGateways() + .getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName, context); + } + + public void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request) { + serviceManager + .virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections(resourceGroupName, virtualNetworkGatewayName, request); + } + + public void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request, Context context) { + serviceManager + .virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections( + resourceGroupName, virtualNetworkGatewayName, request, context); + } + + public VirtualNetworkGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkGatewayImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualNetworkGatewayImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public VirtualNetworkGatewayImpl withGatewayType(VirtualNetworkGatewayType gatewayType) { + this.innerModel().withGatewayType(gatewayType); + return this; + } + + public VirtualNetworkGatewayImpl withVpnType(VpnType vpnType) { + this.innerModel().withVpnType(vpnType); + return this; + } + + public VirtualNetworkGatewayImpl withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration) { + this.innerModel().withVpnGatewayGeneration(vpnGatewayGeneration); + return this; + } + + public VirtualNetworkGatewayImpl withEnableBgp(Boolean enableBgp) { + this.innerModel().withEnableBgp(enableBgp); + return this; + } + + public VirtualNetworkGatewayImpl withEnablePrivateIpAddress(Boolean enablePrivateIpAddress) { + this.innerModel().withEnablePrivateIpAddress(enablePrivateIpAddress); + return this; + } + + public VirtualNetworkGatewayImpl withActive(Boolean active) { + this.innerModel().withActive(active); + return this; + } + + public VirtualNetworkGatewayImpl 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 withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + public VirtualNetworkGatewayImpl withCustomRoutes(AddressSpace customRoutes) { + this.innerModel().withCustomRoutes(customRoutes); + return this; + } + + public VirtualNetworkGatewayImpl withEnableDnsForwarding(Boolean enableDnsForwarding) { + this.innerModel().withEnableDnsForwarding(enableDnsForwarding); + return this; + } + + public VirtualNetworkGatewayImpl withVNetExtendedLocationResourceId(String vNetExtendedLocationResourceId) { + this.innerModel().withVNetExtendedLocationResourceId(vNetExtendedLocationResourceId); + return this; + } + + public VirtualNetworkGatewayImpl withNatRules(List natRules) { + this.innerModel().withNatRules(natRules); + return this; + } + + public VirtualNetworkGatewayImpl withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.innerModel().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java new file mode 100644 index 0000000000000..a2f66b3d7dccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import java.util.Collections; +import java.util.List; + +public final class VirtualNetworkGatewayNatRuleImpl + implements VirtualNetworkGatewayNatRule, + VirtualNetworkGatewayNatRule.Definition, + VirtualNetworkGatewayNatRule.Update { + private VirtualNetworkGatewayNatRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnNatRuleType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public VpnNatRuleMode mode() { + return this.innerModel().mode(); + } + + public List internalMappings() { + List inner = this.innerModel().internalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List externalMappings() { + List inner = this.innerModel().externalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ipConfigurationId() { + return this.innerModel().ipConfigurationId(); + } + + public VirtualNetworkGatewayNatRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkGatewayName; + + private String natRuleName; + + public VirtualNetworkGatewayNatRuleImpl withExistingVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + this.resourceGroupName = resourceGroupName; + this.virtualNetworkGatewayName = virtualNetworkGatewayName; + return this; + } + + public VirtualNetworkGatewayNatRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayNatRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayNatRuleImpl( + String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkGatewayNatRuleInner(); + this.serviceManager = serviceManager; + this.natRuleName = name; + } + + public VirtualNetworkGatewayNatRuleImpl update() { + return this; + } + + public VirtualNetworkGatewayNatRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate( + resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetworkGatewayNatRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .createOrUpdate(resourceGroupName, virtualNetworkGatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VirtualNetworkGatewayNatRuleImpl( + VirtualNetworkGatewayNatRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VirtualNetworkGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworkGatewayNatRules() + .getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VirtualNetworkGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java new file mode 100644 index 0000000000000..331dfb8f31cbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java @@ -0,0 +1,1207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualNetworkGatewayNatRulesResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewayNatRulesClient. */ +public final class VirtualNetworkGatewayNatRulesClientImpl implements VirtualNetworkGatewayNatRulesClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewayNatRulesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewayNatRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewayNatRulesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VirtualNetworkGatewayNatRulesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGatewayNatRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewayNatRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualNetworkGatewayNatRuleInner natRuleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @PathParam("natRuleName") String natRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualNetworkGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualNetworkGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayNatRuleInner get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + return getAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).block(); + } + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + natRuleName, + apiVersion, + natRuleParameters, + accept, + context); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, context) + .getSyncPoller(); + } + + /** + * Creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the existing nat rules. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param natRuleParameters Parameters supplied to create or Update a Nat Rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context).getSyncPoller(); + } + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualNetworkGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualNetworkGatewayAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedFlux<>( + () -> listByVirtualNetworkGatewaySinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + nextLink -> listByVirtualNetworkGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualNetworkGatewayAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedFlux<>( + () -> listByVirtualNetworkGatewaySinglePageAsync(resourceGroupName, virtualNetworkGatewayName, context), + nextLink -> listByVirtualNetworkGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedIterable<>(listByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName)); + } + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedIterable<>( + listByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..42d829b9e8325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewayNatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewayNatRulesImpl implements VirtualNetworkGatewayNatRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayNatRulesImpl.class); + + private final VirtualNetworkGatewayNatRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewayNatRulesImpl( + VirtualNetworkGatewayNatRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGatewayNatRule get( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + VirtualNetworkGatewayNatRuleInner inner = + this.serviceClient().get(resourceGroupName, virtualNetworkGatewayName, natRuleName); + if (inner != null) { + return new VirtualNetworkGatewayNatRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayNatRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, natRuleName); + } + + public void delete( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName) { + PagedIterable inner = + this.serviceClient().listByVirtualNetworkGateway(resourceGroupName, virtualNetworkGatewayName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVirtualNetworkGateway(resourceGroupName, virtualNetworkGatewayName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public VirtualNetworkGatewayNatRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + String natRuleName = Utils.getValueFromIdByName(id, "natRules"); + if (natRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'natRules'.", id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, natRuleName, context); + } + + private VirtualNetworkGatewayNatRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayNatRuleImpl define(String name) { + return new VirtualNetworkGatewayNatRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java new file mode 100644 index 0000000000000..71b5e864f7807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java @@ -0,0 +1,6327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayListConnectionsResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkGatewaysClient. */ +public final class VirtualNetworkGatewaysClientImpl implements VirtualNetworkGatewaysClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualNetworkGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkGateways to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkGatewaysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkGatewayInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/connections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConnections( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("gatewayVip") String gatewayVip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetVpnClientSharedKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generatevpnclientpackage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateVpnProfile( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnProfilePackageUrl( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getBgpPeerStatus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("peer") String peer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> supportedVpnDevices( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getLearnedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getAdvertisedRoutes( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("peer") String peer, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setVpnclientIpsecParameters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnClientIPsecParametersInner vpnclientIpsecParams, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnclientIpsecParameters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections" + + "/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> vpnDeviceConfigurationScript( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayConnectionName") String virtualNetworkGatewayConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnDeviceScriptParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVpnclientConnectionHealth( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disconnectVirtualNetworkGatewayVpnConnections( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkGatewayName") String virtualNetworkGatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") P2SVpnConnectionRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConnectionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkGatewayName, + VirtualNetworkGatewayInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to create or update virtual network gateway operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).getSyncPoller(); + } + + /** + * Updates a virtual network gateway tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to update virtual network gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listConnections( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedFlux<>( + () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName), + nextLink -> listConnectionsNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConnectionsAsync( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedFlux<>( + () -> listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName, context), + nextLink -> listConnectionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName) { + return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName)); + } + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return new PagedIterable<>(listConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, context)); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + gatewayVip, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).getSyncPoller(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginReset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).getSyncPoller(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information 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. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName) { + final String gatewayVip = null; + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).block(); + } + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkGatewayInner reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return resetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context).block(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetVpnClientSharedKey( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatevpnclientpackage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters) + .getSyncPoller(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGeneratevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateVpnProfile( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGenerateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnProfilePackageUrl( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetVpnProfilePackageUrl( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBgpPeerStatus( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).getSyncPoller(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call 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. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + final String peer = null; + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer).block(); + } + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BgpPeerStatusListResultInner getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return getBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayName, peer, context).block(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName).block(); + } + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, context).block(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLearnedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> beginGetLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, context).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAdvertisedRoutes( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + peer, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer).getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return beginGetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewayName, peer, context) + .getSyncPoller(); + } + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + vpnclientIpsecParams, + accept, + context); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + return beginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) + .getSyncPoller(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + return beginSetVpnclientIpsecParametersAsync( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context) + .getSyncPoller(); + } + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnclientIpsecParameters( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, context) + .getSyncPoller(); + } + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + .block(); + } + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName) { + final VpnPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); + } + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context).block(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters).getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVpnclientConnectionHealth( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkGatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName).getSyncPoller(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return beginGetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetworkGatewayName, context) + .getSyncPoller(); + } + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request) + .getSyncPoller(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + return beginDisconnectVirtualNetworkGatewayVpnConnectionsAsync( + resourceGroupName, virtualNetworkGatewayName, request, context) + .getSyncPoller(); + } + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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..4bab5cf73a7a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatusListResult; +import com.azure.resourcemanager.network.generated.models.GatewayRouteListResult; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionListEntity; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateways; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkGatewaysImpl implements VirtualNetworkGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaysImpl.class); + + private final VirtualNetworkGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkGatewaysImpl( + VirtualNetworkGatewaysClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualNetworkGateway getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewayInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName); + } + + public void delete(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkGatewayName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName, context); + return Utils + .mapPage(inner, inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + public VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) { + VirtualNetworkGatewayInner inner = + this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName) { + VirtualNetworkGatewayInner inner = this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualNetworkGateway reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + VirtualNetworkGatewayInner inner = + this.serviceClient().reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip, context); + if (inner != null) { + return new VirtualNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) { + this.serviceClient().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName); + } + + public void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + this.serviceClient().resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.serviceClient().generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this + .serviceClient() + .generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.serviceClient().generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this + .serviceClient() + .generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName); + } + + public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this.serviceClient().getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, context); + } + + public BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + BgpPeerStatusListResultInner inner = + this.serviceClient().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, context); + if (inner != null) { + return new BgpPeerStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + public Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this + .serviceClient() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public GatewayRouteListResult getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + GatewayRouteListResultInner inner = + this.serviceClient().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + GatewayRouteListResultInner inner = + this.serviceClient().getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer) { + GatewayRouteListResultInner inner = + this.serviceClient().getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + GatewayRouteListResultInner inner = + this.serviceClient().getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, context); + if (inner != null) { + return new GatewayRouteListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + VpnClientIPsecParametersInner inner = + this + .serviceClient() + .setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context) { + VpnClientIPsecParametersInner inner = + this + .serviceClient() + .setVpnclientIpsecParameters( + resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, context); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName) { + VpnClientIPsecParametersInner inner = + this.serviceClient().getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + VpnClientIPsecParametersInner inner = + this.serviceClient().getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new VpnClientIPsecParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return this + .serviceClient() + .vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + } + + public Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context) { + return this + .serviceClient() + .vpnDeviceConfigurationScriptWithResponse( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, context); + } + + public String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().startPacketCapture(resourceGroupName, virtualNetworkGatewayName); + } + + public String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters); + } + + public String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parameters, context); + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName) { + VpnClientConnectionHealthDetailListResultInner inner = + this.serviceClient().getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName); + if (inner != null) { + return new VpnClientConnectionHealthDetailListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context) { + VpnClientConnectionHealthDetailListResultInner inner = + this.serviceClient().getVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayName, context); + if (inner != null) { + return new VpnClientConnectionHealthDetailListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + this + .serviceClient() + .disconnectVirtualNetworkGatewayVpnConnections(resourceGroupName, virtualNetworkGatewayName, request); + } + + public void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + this + .serviceClient() + .disconnectVirtualNetworkGatewayVpnConnections( + resourceGroupName, virtualNetworkGatewayName, request, context); + } + + public VirtualNetworkGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = Utils.getValueFromIdByName(id, "virtualNetworkGateways"); + if (virtualNetworkGatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkGateways'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkGatewayName, context); + } + + private VirtualNetworkGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkGatewayImpl define(String name) { + return new VirtualNetworkGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java new file mode 100644 index 0000000000000..5c8f0b2cf6e20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VirtualNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualNetworkName; + + private TagsObject updateParameters; + + public VirtualNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), context); + return this; + } + + VirtualNetworkImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualNetworkInner(); + this.serviceManager = serviceManager; + this.virtualNetworkName = name; + } + + public VirtualNetworkImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public VirtualNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .updateTagsWithResponse(resourceGroupName, virtualNetworkName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .updateTagsWithResponse(resourceGroupName, virtualNetworkName, updateParameters, context) + .getValue(); + return this; + } + + VirtualNetworkImpl( + VirtualNetworkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + } + + public VirtualNetwork refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualNetwork refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, context) + .getValue(); + return this; + } + + public VirtualNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VirtualNetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualNetworkImpl withAddressSpace(AddressSpace addressSpace) { + this.innerModel().withAddressSpace(addressSpace); + return this; + } + + public VirtualNetworkImpl withDhcpOptions(DhcpOptions dhcpOptions) { + this.innerModel().withDhcpOptions(dhcpOptions); + return this; + } + + public VirtualNetworkImpl withFlowTimeoutInMinutes(Integer flowTimeoutInMinutes) { + this.innerModel().withFlowTimeoutInMinutes(flowTimeoutInMinutes); + return this; + } + + public VirtualNetworkImpl withSubnets(List subnets) { + this.innerModel().withSubnets(subnets); + return this; + } + + public VirtualNetworkImpl withVirtualNetworkPeerings(List virtualNetworkPeerings) { + this.innerModel().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + + public VirtualNetworkImpl withEnableDdosProtection(Boolean enableDdosProtection) { + this.innerModel().withEnableDdosProtection(enableDdosProtection); + return this; + } + + public VirtualNetworkImpl withEnableVmProtection(Boolean enableVmProtection) { + this.innerModel().withEnableVmProtection(enableVmProtection); + return this; + } + + public VirtualNetworkImpl withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.innerModel().withDdosProtectionPlan(ddosProtectionPlan); + return this; + } + + public VirtualNetworkImpl withBgpCommunities(VirtualNetworkBgpCommunities bgpCommunities) { + this.innerModel().withBgpCommunities(bgpCommunities); + return this; + } + + public VirtualNetworkImpl 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..e0602d08be6f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.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 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..88dd767b781a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java @@ -0,0 +1,1343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkPeeringsClient. */ +public final class VirtualNetworkPeeringsClientImpl implements VirtualNetworkPeeringsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualNetworkPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkPeerings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @PathParam("virtualNetworkPeeringName") String virtualNetworkPeeringName, + @QueryParam("syncRemoteAddressSpace") SyncRemoteAddressSpace syncRemoteAddressSpace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).block(); + } + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + syncRemoteAddressSpace, + apiVersion, + this.client.getSubscriptionId(), + virtualNetworkPeeringParameters, + accept, + context); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context) + .getSyncPoller(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource 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. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace) { + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .block(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + final SyncRemoteAddressSpace syncRemoteAddressSpace = null; + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace) + .block(); + } + + /** + * Creates or updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create or update virtual network peering + * operation. + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current address + * space on the remote vNet after it's updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkPeeringInner createOrUpdate( + String resourceGroupName, + String virtualNetworkName, + String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, + SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + virtualNetworkName, + virtualNetworkPeeringName, + virtualNetworkPeeringParameters, + syncRemoteAddressSpace, + context) + .block(); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSubnets API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..c02c87bf7516f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeering; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkPeeringsImpl implements VirtualNetworkPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringsImpl.class); + + private final VirtualNetworkPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkPeeringsImpl( + VirtualNetworkPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); + } + + public void delete( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + public VirtualNetworkPeering get( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + VirtualNetworkPeeringInner inner = + this.serviceClient().get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName); + if (inner != null) { + return new VirtualNetworkPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public VirtualNetworkPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this + .getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + return this.getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String virtualNetworkPeeringName = Utils.getValueFromIdByName(id, "virtualNetworkPeerings"); + if (virtualNetworkPeeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkPeerings'.", + id))); + } + this.delete(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, context); + } + + private VirtualNetworkPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkPeeringImpl define(String name) { + return new VirtualNetworkPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java new file mode 100644 index 0000000000000..05dafe9d03852 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.FrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VirtualNetworkTapImpl + implements VirtualNetworkTap, VirtualNetworkTap.Definition, VirtualNetworkTap.Update { + private VirtualNetworkTapInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..92770e8e8f24f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.java @@ -0,0 +1,1450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTapListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworkTapsClient. */ +public final class VirtualNetworkTapsClientImpl implements VirtualNetworkTapsClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworkTapsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworkTapsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworkTapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworkTapsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualNetworkTapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworkTaps to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworkTapsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkTapInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps/{tapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("tapName") String tapName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject tapParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworkTaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName) { + return beginDeleteAsync(resourceGroupName, tapName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName, Context context) { + return beginDeleteAsync(resourceGroupName, tapName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { + return getByResourceGroupAsync(resourceGroupName, tapName).block(); + } + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, tapName, context).block(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + tapName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, tapName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a Virtual Network Tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param parameters Parameters supplied to the create or update virtual network tap operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters) { + return updateTagsAsync(resourceGroupName, tapName, tapParameters).block(); + } + + /** + * Updates an VirtualNetworkTap tags. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the tap. + * @param tapParameters Parameters supplied to update VirtualNetworkTap tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network Tap resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..406b4498f48f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworkTapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTaps; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworkTapsImpl implements VirtualNetworkTaps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapsImpl.class); + + private final VirtualNetworkTapsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworkTapsImpl( + VirtualNetworkTapsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String tapName) { + this.serviceClient().delete(resourceGroupName, tapName); + } + + public void delete(String resourceGroupName, String tapName, Context context) { + this.serviceClient().delete(resourceGroupName, tapName, context); + } + + public VirtualNetworkTap getByResourceGroup(String resourceGroupName, String tapName) { + VirtualNetworkTapInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, tapName); + if (inner != null) { + return new VirtualNetworkTapImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, tapName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkTapImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public VirtualNetworkTap getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, tapName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = Utils.getValueFromIdByName(id, "virtualNetworkTaps"); + if (tapName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkTaps'.", id))); + } + this.delete(resourceGroupName, tapName, context); + } + + private VirtualNetworkTapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkTapImpl define(String name) { + return new VirtualNetworkTapImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java new file mode 100644 index 0000000000000..8f914ecd9a315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; + +public final class VirtualNetworkUsageImpl implements VirtualNetworkUsage { + private VirtualNetworkUsageInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkUsageImpl( + VirtualNetworkUsageInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String id() { + return this.innerModel().id(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public VirtualNetworkUsageName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public VirtualNetworkUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java new file mode 100644 index 0000000000000..d2f67b7bee53e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java @@ -0,0 +1,1964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkListResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkListUsageResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ +public final class VirtualNetworksClientImpl implements VirtualNetworksClient { + private final ClientLogger logger = new ClientLogger(VirtualNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualNetworksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualNetworksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualNetworks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualNetworksService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualNetworkInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkIpAddressAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("ipAddress") String ipAddress, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualNetworks/{virtualNetworkName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsage( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsageNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName).getSyncPoller(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, context).getSyncPoller(); + } + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualNetworkName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, virtualNetworkName, expand).block(); + } + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create or update virtual network operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, virtualNetworkName, parameters).block(); + } + + /** + * Updates a virtual network tags. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to update virtual network tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Network resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual networks in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all virtual networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpAddressAvailabilityResultInner checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIpAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).block(); + } + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsage( + this.client.getEndpoint(), + resourceGroupName, + virtualNetworkName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync(String resourceGroupName, String virtualNetworkName) { + return new PagedFlux<>( + () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName), + nextLink -> listUsageNextSinglePageAsync(nextLink)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listUsageAsync( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedFlux<>( + () -> listUsageSinglePageAsync(resourceGroupName, virtualNetworkName, context), + nextLink -> listUsageNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { + return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName)); + } + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context) { + return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java new file mode 100644 index 0000000000000..2640b458e1811 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.azure.resourcemanager.network.generated.models.IpAddressAvailabilityResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualNetworksImpl implements VirtualNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworksImpl.class); + + private final VirtualNetworksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualNetworksImpl( + VirtualNetworksClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualNetworkName) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName); + } + + public void delete(String resourceGroupName, String virtualNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualNetworkName, context); + } + + public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); + if (inner != null) { + return new VirtualNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public IpAddressAvailabilityResult checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress) { + IpAddressAvailabilityResultInner inner = + this.serviceClient().checkIpAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress); + if (inner != null) { + return new IpAddressAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context) { + Response inner = + this + .serviceClient() + .checkIpAddressAvailabilityWithResponse(resourceGroupName, virtualNetworkName, ipAddress, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpAddressAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner = + this.serviceClient().listUsage(resourceGroupName, virtualNetworkName); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public PagedIterable listUsage( + String resourceGroupName, String virtualNetworkName, Context context) { + PagedIterable inner = + this.serviceClient().listUsage(resourceGroupName, virtualNetworkName, context); + return Utils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public VirtualNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + if (virtualNetworkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + } + this.delete(resourceGroupName, virtualNetworkName, context); + } + + private VirtualNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualNetworkImpl define(String name) { + return new VirtualNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java new file mode 100644 index 0000000000000..d12ba515612db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualRouter; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualRouterImpl implements VirtualRouter, VirtualRouter.Definition, VirtualRouter.Update { + private VirtualRouterInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 VirtualRouterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualRouterName; + + public VirtualRouterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualRouter create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouter create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), context); + return this; + } + + VirtualRouterImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualRouterInner(); + this.serviceManager = serviceManager; + this.virtualRouterName = name; + } + + public VirtualRouterImpl update() { + return this; + } + + public VirtualRouter apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouter apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .createOrUpdate(resourceGroupName, virtualRouterName, this.innerModel(), context); + return this; + } + + VirtualRouterImpl( + VirtualRouterInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + } + + public VirtualRouter refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouter refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouters() + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, context) + .getValue(); + return this; + } + + public VirtualRouterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualRouterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualRouterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public VirtualRouterImpl withVirtualRouterAsn(Long virtualRouterAsn) { + this.innerModel().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + public VirtualRouterImpl withVirtualRouterIps(List virtualRouterIps) { + this.innerModel().withVirtualRouterIps(virtualRouterIps); + return this; + } + + public VirtualRouterImpl withHostedSubnet(SubResource hostedSubnet) { + this.innerModel().withHostedSubnet(hostedSubnet); + return this; + } + + public VirtualRouterImpl withHostedGateway(SubResource hostedGateway) { + this.innerModel().withHostedGateway(hostedGateway); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java new file mode 100644 index 0000000000000..41314f9e18743 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeering; + +public final class VirtualRouterPeeringImpl + implements VirtualRouterPeering, VirtualRouterPeering.Definition, VirtualRouterPeering.Update { + private VirtualRouterPeeringInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public Long peerAsn() { + return this.innerModel().peerAsn(); + } + + public String peerIp() { + return this.innerModel().peerIp(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VirtualRouterPeeringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualRouterName; + + private String peeringName; + + public VirtualRouterPeeringImpl withExistingVirtualRouter(String resourceGroupName, String virtualRouterName) { + this.resourceGroupName = resourceGroupName; + this.virtualRouterName = virtualRouterName; + return this; + } + + public VirtualRouterPeering create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouterPeering create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), context); + return this; + } + + VirtualRouterPeeringImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VirtualRouterPeeringInner(); + this.serviceManager = serviceManager; + this.peeringName = name; + } + + public VirtualRouterPeeringImpl update() { + return this; + } + + public VirtualRouterPeering apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualRouterPeering apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .createOrUpdate(resourceGroupName, virtualRouterName, peeringName, this.innerModel(), context); + return this; + } + + VirtualRouterPeeringImpl( + VirtualRouterPeeringInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = Utils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); + } + + public VirtualRouterPeering refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE) + .getValue(); + return this; + } + + public VirtualRouterPeering refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualRouterPeerings() + .getWithResponse(resourceGroupName, virtualRouterName, peeringName, context) + .getValue(); + return this; + } + + public VirtualRouterPeeringImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VirtualRouterPeeringImpl withPeerAsn(Long peerAsn) { + this.innerModel().withPeerAsn(peerAsn); + return this; + } + + public VirtualRouterPeeringImpl withPeerIp(String peerIp) { + this.innerModel().withPeerIp(peerIp); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java new file mode 100644 index 0000000000000..9e40320e90adb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java @@ -0,0 +1,1144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeeringListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualRouterPeeringsClient. */ +public final class VirtualRouterPeeringsClientImpl implements VirtualRouterPeeringsClient { + private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualRouterPeeringsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualRouterPeeringsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualRouterPeeringsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VirtualRouterPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualRouterPeerings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualRouterPeeringsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings/{peeringName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @PathParam("peeringName") String peeringName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualRouterPeeringInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}/peerings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualRouterName, String peeringName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName).getSyncPoller(); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, peeringName, context).getSyncPoller(); + } + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterPeeringInner get(String resourceGroupName, String virtualRouterName, String peeringName) { + return getAsync(resourceGroupName, virtualRouterName, peeringName).block(); + } + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + peeringName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualRouterName, + String peeringName, + VirtualRouterPeeringInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, peeringName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param parameters Parameters supplied to the create or update Virtual Router Peering operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Router Peering resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String virtualRouterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualRouterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String virtualRouterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, virtualRouterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualRouterName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualRouterName)); + } + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String virtualRouterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualRouterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call 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 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..3d64a7480b34d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualRouterPeeringsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeering; +import com.azure.resourcemanager.network.generated.models.VirtualRouterPeerings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualRouterPeeringsImpl implements VirtualRouterPeerings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringsImpl.class); + + private final VirtualRouterPeeringsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualRouterPeeringsImpl( + VirtualRouterPeeringsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String virtualRouterName, String peeringName) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, peeringName); + } + + public void delete(String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, peeringName, context); + } + + public VirtualRouterPeering get(String resourceGroupName, String virtualRouterName, String peeringName) { + VirtualRouterPeeringInner inner = this.serviceClient().get(resourceGroupName, virtualRouterName, peeringName); + if (inner != null) { + return new VirtualRouterPeeringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualRouterName, peeringName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualRouterPeeringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String virtualRouterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualRouterName); + return Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String virtualRouterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, virtualRouterName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public VirtualRouterPeering getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualRouterName, peeringName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String peeringName = Utils.getValueFromIdByName(id, "peerings"); + if (peeringName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, peeringName, context); + } + + private VirtualRouterPeeringsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterPeeringImpl define(String name) { + return new VirtualRouterPeeringImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java new file mode 100644 index 0000000000000..d384ba25cf853 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.ErrorException; +import com.azure.resourcemanager.network.generated.models.VirtualRouterListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualRoutersClient. */ +public final class VirtualRoutersClientImpl implements VirtualRoutersClient { + private final ClientLogger logger = new ClientLogger(VirtualRoutersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualRoutersService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualRoutersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualRoutersClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualRoutersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualRouters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualRoutersService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters/{virtualRouterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualRouterName") String virtualRouterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VirtualRouterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualRouters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualRouterName) { + return beginDeleteAsync(resourceGroupName, virtualRouterName).getSyncPoller(); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualRouterName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualRouterName, context).getSyncPoller(); + } + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String virtualRouterName, String expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualRouterInner getByResourceGroup(String resourceGroupName, String virtualRouterName) { + final String expand = null; + return getByResourceGroupAsync(resourceGroupName, virtualRouterName, expand).block(); + } + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + virtualRouterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, VirtualRouterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualRouterName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param parameters Parameters supplied to the create or update Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualRouter Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call 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 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 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 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..05c86c1017c5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualRoutersClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.azure.resourcemanager.network.generated.models.VirtualRouter; +import com.azure.resourcemanager.network.generated.models.VirtualRouters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualRoutersImpl implements VirtualRouters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRoutersImpl.class); + + private final VirtualRoutersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualRoutersImpl( + VirtualRoutersClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualRouterName) { + this.serviceClient().delete(resourceGroupName, virtualRouterName); + } + + public void delete(String resourceGroupName, String virtualRouterName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualRouterName, context); + } + + public VirtualRouter getByResourceGroup(String resourceGroupName, String virtualRouterName) { + VirtualRouterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualRouterName); + if (inner != null) { + return new VirtualRouterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualRouterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public VirtualRouter getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + String localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = Utils.getValueFromIdByName(id, "virtualRouters"); + if (virtualRouterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualRouters'.", id))); + } + this.delete(resourceGroupName, virtualRouterName, context); + } + + private VirtualRoutersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualRouterImpl define(String name) { + return new VirtualRouterImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java new file mode 100644 index 0000000000000..12535f19c2aaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualWanImpl implements VirtualWan, VirtualWan.Definition, VirtualWan.Update { + private VirtualWanInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..39251ebf91499 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.java @@ -0,0 +1,1448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualWansResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualWansClient. */ +public final class VirtualWansClientImpl implements VirtualWansClient { + private final ClientLogger logger = new ClientLogger(VirtualWansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualWansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VirtualWansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualWansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VirtualWansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVirtualWans to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VirtualWansService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VirtualWanInner wanParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject wanParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{VirtualWANName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("VirtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/virtualWans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner getByResourceGroup(String resourceGroupName, String virtualWanName) { + return getByResourceGroupAsync(resourceGroupName, virtualWanName).block(); + } + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName, context).block(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + wanParameters, + accept, + context); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters).getSyncPoller(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate( + String resourceGroupName, String virtualWanName, VirtualWanInner wanParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualWanName, wanParameters, context).getSyncPoller(); + } + + /** + * Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being created or updated. + * @param wanParameters Parameters supplied to create or update VirtualWAN. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters) { + return updateTagsAsync(resourceGroupName, virtualWanName, wanParameters).block(); + } + + /** + * Updates a VirtualWAN tags. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being updated. + * @param wanParameters Parameters supplied to Update VirtualWAN tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName) { + return beginDeleteAsync(resourceGroupName, virtualWanName).getSyncPoller(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String virtualWanName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualWanName, context).getSyncPoller(); + } + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..ada14c14d9a21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import com.azure.resourcemanager.network.generated.models.VirtualWans; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VirtualWansImpl implements VirtualWans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWansImpl.class); + + private final VirtualWansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VirtualWansImpl( + VirtualWansClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VirtualWan getByResourceGroup(String resourceGroupName, String virtualWanName) { + VirtualWanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualWanName); + if (inner != null) { + return new VirtualWanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualWanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualWanName) { + this.serviceClient().delete(resourceGroupName, virtualWanName); + } + + public void delete(String resourceGroupName, String virtualWanName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualWanName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public VirtualWan getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualWanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = Utils.getValueFromIdByName(id, "virtualWans"); + if (virtualWanName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualWans'.", id))); + } + this.delete(resourceGroupName, virtualWanName, context); + } + + private VirtualWansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VirtualWanImpl define(String name) { + return new VirtualWanImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java new file mode 100644 index 0000000000000..7b4dad39cf768 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetailListResult; +import java.util.Collections; +import java.util.List; + +public final class VpnClientConnectionHealthDetailListResultImpl implements VpnClientConnectionHealthDetailListResult { + private VpnClientConnectionHealthDetailListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientConnectionHealthDetailListResultImpl( + VpnClientConnectionHealthDetailListResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnClientConnectionHealthDetailListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java new file mode 100644 index 0000000000000..adf02429e54fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; +import com.azure.resourcemanager.network.generated.models.DhGroup; +import com.azure.resourcemanager.network.generated.models.IkeEncryption; +import com.azure.resourcemanager.network.generated.models.IkeIntegrity; +import com.azure.resourcemanager.network.generated.models.IpsecEncryption; +import com.azure.resourcemanager.network.generated.models.IpsecIntegrity; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.azure.resourcemanager.network.generated.models.VpnClientIPsecParameters; + +public final class VpnClientIPsecParametersImpl implements VpnClientIPsecParameters { + private VpnClientIPsecParametersInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnClientIPsecParametersImpl( + VpnClientIPsecParametersInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int saLifeTimeSeconds() { + return this.innerModel().saLifeTimeSeconds(); + } + + public int saDataSizeKilobytes() { + return this.innerModel().saDataSizeKilobytes(); + } + + public IpsecEncryption ipsecEncryption() { + return this.innerModel().ipsecEncryption(); + } + + public IpsecIntegrity ipsecIntegrity() { + return this.innerModel().ipsecIntegrity(); + } + + public IkeEncryption ikeEncryption() { + return this.innerModel().ikeEncryption(); + } + + public IkeIntegrity ikeIntegrity() { + return this.innerModel().ikeIntegrity(); + } + + public DhGroup dhGroup() { + return this.innerModel().dhGroup(); + } + + public PfsGroup pfsGroup() { + return this.innerModel().pfsGroup(); + } + + public VpnClientIPsecParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java new file mode 100644 index 0000000000000..1a364be203cff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VpnConnectionImpl implements VpnConnection { + private VpnConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnConnectionImpl( + VpnConnectionInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SubResource remoteVpnSite() { + return this.innerModel().remoteVpnSite(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public Integer dpdTimeoutSeconds() { + return this.innerModel().dpdTimeoutSeconds(); + } + + public VpnConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerModel().vpnConnectionProtocolType(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Integer connectionBandwidth() { + return this.innerModel().connectionBandwidth(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List trafficSelectorPolicies() { + List inner = this.innerModel().trafficSelectorPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableRateLimiting() { + return this.innerModel().enableRateLimiting(); + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List vpnLinkConnections() { + List inner = this.innerModel().vpnLinkConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public VpnConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java new file mode 100644 index 0000000000000..a33dd423f98ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java @@ -0,0 +1,1907 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVpnConnectionsResult; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnConnectionsClient. */ +public final class VpnConnectionsClientImpl implements VpnConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnConnections to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnConnectionInner vpnConnectionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("vpnConnectionName") String vpnConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnConnectionPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("vpnConnectionName") String vpnConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnConnectionPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnGatewayNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { + return getAsync(resourceGroupName, gatewayName, connectionName).block(); + } + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + vpnConnectionParameters, + accept, + context); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context) + .getSyncPoller(); + } + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, String connectionName) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName).getSyncPoller(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, connectionName, context).getSyncPoller(); + } + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + vpnConnectionName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStopParameters parameters = null; + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters).block(); + } + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters, context).block(); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync(String resourceGroupName, String gatewayName) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnGatewayAsync( + String resourceGroupName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName, context), + nextLink -> listByVpnGatewayNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName)); + } + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + return new PagedIterable<>(listByVpnGatewayAsync(resourceGroupName, gatewayName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..24f67e372729d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnConnection; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnConnectionsImpl implements VpnConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionsImpl.class); + + private final VpnConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnConnectionsImpl( + VpnConnectionsClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnConnection get(String resourceGroupName, String gatewayName, String connectionName) { + VpnConnectionInner inner = this.serviceClient().get(resourceGroupName, gatewayName, connectionName); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, gatewayName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters) { + VpnConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context) { + VpnConnectionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, context); + if (inner != null) { + return new VpnConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String gatewayName, String connectionName) { + this.serviceClient().delete(resourceGroupName, gatewayName, connectionName); + } + + public void delete(String resourceGroupName, String gatewayName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, connectionName, context); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context) { + return this + .serviceClient() + .startPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters); + } + + public String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context) { + return this + .serviceClient() + .stopPacketCapture(resourceGroupName, gatewayName, vpnConnectionName, parameters, context); + } + + public PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName) { + PagedIterable inner = this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName); + return Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnGateway( + String resourceGroupName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnGateway(resourceGroupName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new VpnConnectionImpl(inner1, this.manager())); + } + + private VpnConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.java new file mode 100644 index 0000000000000..da5878f9049ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.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.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 VpnGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayName; + + private TagsObject updateVpnGatewayParameters; + + public VpnGatewayImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnGateway create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGateway create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .createOrUpdate(resourceGroupName, gatewayName, this.innerModel(), context); + return this; + } + + VpnGatewayImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnGatewayInner(); + this.serviceManager = serviceManager; + this.gatewayName = name; + } + + public VpnGatewayImpl update() { + this.updateVpnGatewayParameters = new TagsObject(); + return this; + } + + public VpnGateway apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateVpnGatewayParameters, Context.NONE); + return this; + } + + public VpnGateway apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .updateTags(resourceGroupName, gatewayName, updateVpnGatewayParameters, context); + return this; + } + + VpnGatewayImpl( + VpnGatewayInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + } + + public VpnGateway refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public VpnGateway refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnGateways() + .getByResourceGroupWithResponse(resourceGroupName, gatewayName, context) + .getValue(); + return this; + } + + public VpnGateway reset() { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName); + } + + public VpnGateway reset(Context context) { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName, context); + } + + public String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters) { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String startPacketCapture() { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName); + } + + public String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters, Context context) { + return serviceManager.vpnGateways().startPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters) { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String stopPacketCapture() { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName); + } + + public String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters, Context context) { + return serviceManager.vpnGateways().stopPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public VpnGatewayImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnGatewayImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnGatewayImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnGatewayParameters.withTags(tags); + return this; + } + } + + public VpnGatewayImpl withVirtualHub(SubResource virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public VpnGatewayImpl withConnections(List connections) { + this.innerModel().withConnections(connections); + return this; + } + + public VpnGatewayImpl withBgpSettings(BgpSettings bgpSettings) { + this.innerModel().withBgpSettings(bgpSettings); + return this; + } + + public VpnGatewayImpl withVpnGatewayScaleUnit(Integer vpnGatewayScaleUnit) { + this.innerModel().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + + public VpnGatewayImpl 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..ea97d3b7c7ed7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMapping; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleMode; +import com.azure.resourcemanager.network.generated.models.VpnNatRuleType; +import java.util.Collections; +import java.util.List; + +public final class VpnGatewayNatRuleImpl + implements VpnGatewayNatRule, VpnGatewayNatRule.Definition, VpnGatewayNatRule.Update { + private VpnGatewayNatRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnNatRuleType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public VpnNatRuleMode mode() { + return this.innerModel().mode(); + } + + public List internalMappings() { + List inner = this.innerModel().internalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List externalMappings() { + List inner = this.innerModel().externalMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ipConfigurationId() { + return this.innerModel().ipConfigurationId(); + } + + public List egressVpnSiteLinkConnections() { + List inner = this.innerModel().egressVpnSiteLinkConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List ingressVpnSiteLinkConnections() { + List inner = this.innerModel().ingressVpnSiteLinkConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnGatewayNatRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String gatewayName; + + private String natRuleName; + + public VpnGatewayNatRuleImpl withExistingVpnGateway(String resourceGroupName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.gatewayName = gatewayName; + return this; + } + + public VpnGatewayNatRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGatewayNatRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VpnGatewayNatRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnGatewayNatRuleInner(); + this.serviceManager = serviceManager; + this.natRuleName = name; + } + + public VpnGatewayNatRuleImpl update() { + return this; + } + + public VpnGatewayNatRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), Context.NONE); + return this; + } + + public VpnGatewayNatRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .createOrUpdate(resourceGroupName, gatewayName, natRuleName, this.innerModel(), context); + return this; + } + + VpnGatewayNatRuleImpl( + VpnGatewayNatRuleInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + this.natRuleName = Utils.getValueFromIdByName(innerObject.id(), "natRules"); + } + + public VpnGatewayNatRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE) + .getValue(); + return this; + } + + public VpnGatewayNatRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNatRules() + .getWithResponse(resourceGroupName, gatewayName, natRuleName, context) + .getValue(); + return this; + } + + public VpnGatewayNatRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VpnGatewayNatRuleImpl withTypePropertiesType(VpnNatRuleType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public VpnGatewayNatRuleImpl withMode(VpnNatRuleMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public VpnGatewayNatRuleImpl withInternalMappings(List internalMappings) { + this.innerModel().withInternalMappings(internalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withExternalMappings(List externalMappings) { + this.innerModel().withExternalMappings(externalMappings); + return this; + } + + public VpnGatewayNatRuleImpl withIpConfigurationId(String ipConfigurationId) { + this.innerModel().withIpConfigurationId(ipConfigurationId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java new file mode 100644 index 0000000000000..8f8acb9ff4015 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java @@ -0,0 +1,2455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.ListVpnGatewaysResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnGatewaysClient. */ +public final class VpnGatewaysClientImpl implements VpnGatewaysClient { + private final ClientLogger logger = new ClientLogger(VpnGatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnGatewaysService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnGatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnGatewaysClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnGateways to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnGatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnGatewayInner vpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnGatewayParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/reset") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reset( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/startpacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnGatewayPacketCaptureStartParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/stoppacketcapture") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopPacketCapture( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VpnGatewayPacketCaptureStopParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner getByResourceGroup(String resourceGroupName, String gatewayName) { + return getByResourceGroupAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to create or Update a virtual wan vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + apiVersion, + vpnGatewayParameters, + accept, + context); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters).getSyncPoller(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginUpdateTags( + String resourceGroupName, String gatewayName, TagsObject vpnGatewayParameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, gatewayName, vpnGatewayParameters, context).getSyncPoller(); + } + + /** + * Updates virtual wan vpn gateway tags. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param vpnGatewayParameters Parameters supplied to update a virtual wan vpn gateway tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { + return beginDeleteAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reset( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName) { + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VpnGatewayInner.class, + VpnGatewayInner.class, + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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.LONG_RUNNING_OPERATION) + private PollerFlux, VpnGatewayInner> beginResetAsync( + String resourceGroupName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = resetWithResponseAsync(resourceGroupName, gatewayName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnGatewayInner.class, VpnGatewayInner.class, context); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName) { + return beginResetAsync(resourceGroupName, gatewayName).getSyncPoller(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginReset( + String resourceGroupName, String gatewayName, Context context) { + return beginResetAsync(resourceGroupName, gatewayName, context).getSyncPoller(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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 vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner reset(String resourceGroupName, String gatewayName) { + return resetAsync(resourceGroupName, gatewayName).block(); + } + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner reset(String resourceGroupName, String gatewayName, Context context) { + return resetAsync(resourceGroupName, gatewayName, context).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return beginStartPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStartParameters parameters = null; + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return startPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPacketCapture( + this.client.getEndpoint(), + resourceGroupName, + gatewayName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @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.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. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).getSyncPoller(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).getSyncPoller(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStopParameters parameters = null; + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters).block(); + } + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return stopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).block(); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..44e2577f9f520 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.azure.resourcemanager.network.generated.models.VpnGateway; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; +import com.azure.resourcemanager.network.generated.models.VpnGateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnGatewaysImpl implements VpnGateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewaysImpl.class); + + private final VpnGatewaysClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnGatewaysImpl( + VpnGatewaysClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnGateway getByResourceGroup(String resourceGroupName, String gatewayName) { + VpnGatewayInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, gatewayName); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String gatewayName) { + this.serviceClient().delete(resourceGroupName, gatewayName); + } + + public void delete(String resourceGroupName, String gatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, gatewayName, context); + } + + public VpnGateway reset(String resourceGroupName, String gatewayName) { + VpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnGateway reset(String resourceGroupName, String gatewayName, Context context) { + VpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, context); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String startPacketCapture(String resourceGroupName, String gatewayName) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName); + } + + public String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context) { + return this.serviceClient().startPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, parameters); + } + + public String stopPacketCapture(String resourceGroupName, String gatewayName) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName); + } + + public String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context) { + return this.serviceClient().stopPacketCapture(resourceGroupName, gatewayName, parameters, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public VpnGateway getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, gatewayName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "vpnGateways"); + if (gatewayName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnGateways'.", id))); + } + this.delete(resourceGroupName, gatewayName, context); + } + + private VpnGatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnGatewayImpl define(String name) { + return new VpnGatewayImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java new file mode 100644 index 0000000000000..4041777cef9f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java @@ -0,0 +1,1006 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSiteLinkConnectionsResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnLinkConnectionsClient. */ +public final class VpnLinkConnectionsClientImpl implements VpnLinkConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnLinkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnLinkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnLinkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnLinkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnLinkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnLinkConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnLinkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}" + + "/resetconnection") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getIkeSas( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnConnectionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .getSyncPoller(); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginResetConnectionAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .getSyncPoller(); + } + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getIkeSas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + linkConnectionName, + apiVersion, + accept, + context); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).getSyncPoller(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return beginGetIkeSasAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context) + .getSyncPoller(); + } + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnConnection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + gatewayName, + connectionName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName) { + return new PagedFlux<>( + () -> listByVpnConnectionSinglePageAsync(resourceGroupName, gatewayName, connectionName), + nextLink -> listByVpnConnectionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnConnectionAsync( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return new PagedFlux<>( + () -> listByVpnConnectionSinglePageAsync(resourceGroupName, gatewayName, connectionName, context), + nextLink -> listByVpnConnectionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName) { + return new PagedIterable<>(listByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName)); + } + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + return new PagedIterable<>(listByVpnConnectionAsync(resourceGroupName, gatewayName, connectionName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..8c78517e1178e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnLinkConnectionsImpl implements VpnLinkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkConnectionsImpl.class); + + private final VpnLinkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnLinkConnectionsImpl( + VpnLinkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + this.serviceClient().resetConnection(resourceGroupName, gatewayName, connectionName, linkConnectionName); + } + + public void resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + this + .serviceClient() + .resetConnection(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + } + + public String getIkeSas( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return this.serviceClient().getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName); + } + + public String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + return this + .serviceClient() + .getIkeSas(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnConnection(resourceGroupName, gatewayName, connectionName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkConnectionImpl(inner1, this.manager())); + } + + private VpnLinkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java new file mode 100644 index 0000000000000..f72d4f53d11de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnProfileResponse; + +public final class VpnProfileResponseImpl implements VpnProfileResponse { + private VpnProfileResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnProfileResponseImpl( + VpnProfileResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String profileUrl() { + return this.innerModel().profileUrl(); + } + + public VpnProfileResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java new file mode 100644 index 0000000000000..7ac5ff8c5e34d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.AadAuthenticationParameters; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnAuthenticationType; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VpnServerConfigurationImpl + implements VpnServerConfiguration, VpnServerConfiguration.Definition, VpnServerConfiguration.Update { + private VpnServerConfigurationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public String 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 String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VpnServerConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vpnServerConfigurationName; + + private TagsObject updateVpnServerConfigurationParameters; + + public VpnServerConfigurationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnServerConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public VpnServerConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, this.innerModel(), context); + return this; + } + + VpnServerConfigurationImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnServerConfigurationInner(); + this.serviceManager = serviceManager; + this.vpnServerConfigurationName = name; + } + + public VpnServerConfigurationImpl update() { + this.updateVpnServerConfigurationParameters = new TagsObject(); + return this; + } + + public VpnServerConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .updateTagsWithResponse( + resourceGroupName, vpnServerConfigurationName, updateVpnServerConfigurationParameters, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .updateTagsWithResponse( + resourceGroupName, vpnServerConfigurationName, updateVpnServerConfigurationParameters, context) + .getValue(); + return this; + } + + VpnServerConfigurationImpl( + VpnServerConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "vpnServerConfigurations"); + } + + public VpnServerConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnServerConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context) + .getValue(); + return this; + } + + public VpnServerConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnServerConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnServerConfigurationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnServerConfigurationParameters.withTags(tags); + return this; + } + } + + public VpnServerConfigurationImpl withNamePropertiesName(String namePropertiesName) { + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; + } + + public VpnServerConfigurationImpl withVpnProtocols(List vpnProtocols) { + this.innerModel().withVpnProtocols(vpnProtocols); + return this; + } + + public VpnServerConfigurationImpl withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.innerModel().withVpnAuthenticationTypes(vpnAuthenticationTypes); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.innerModel().withVpnClientRootCertificates(vpnClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.innerModel().withVpnClientRevokedCertificates(vpnClientRevokedCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerRootCertificates( + List radiusServerRootCertificates) { + this.innerModel().withRadiusServerRootCertificates(radiusServerRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withRadiusClientRootCertificates( + List radiusClientRootCertificates) { + this.innerModel().withRadiusClientRootCertificates(radiusClientRootCertificates); + return this; + } + + public VpnServerConfigurationImpl withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.innerModel().withVpnClientIpsecPolicies(vpnClientIpsecPolicies); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerAddress(String radiusServerAddress) { + this.innerModel().withRadiusServerAddress(radiusServerAddress); + return this; + } + + public VpnServerConfigurationImpl withRadiusServerSecret(String radiusServerSecret) { + this.innerModel().withRadiusServerSecret(radiusServerSecret); + return this; + } + + public VpnServerConfigurationImpl withRadiusServers(List radiusServers) { + this.innerModel().withRadiusServers(radiusServers); + return this; + } + + public VpnServerConfigurationImpl withAadAuthenticationParameters( + AadAuthenticationParameters aadAuthenticationParameters) { + this.innerModel().withAadAuthenticationParameters(aadAuthenticationParameters); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java new file mode 100644 index 0000000000000..730f431145377 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * VpnServerConfigurationsAssociatedWithVirtualWansClient. + */ +public final class VpnServerConfigurationsAssociatedWithVirtualWansClientImpl + implements VpnServerConfigurationsAssociatedWithVirtualWansClient { + private final ClientLogger logger = + new ClientLogger(VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnServerConfigurationsAssociatedWithVirtualWansService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnServerConfigurationsAssociatedWithVirtualWansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnServerConfigurationsAssociatedWithVirtualWansClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + VpnServerConfigurationsAssociatedWithVirtualWansService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * NetworkManagementClientVpnServerConfigurationsAssociatedWithVirtualWans to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnServerConfigurationsAssociatedWithVirtualWansService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/vpnServerConfigurations") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualWanName, + apiVersion, + accept, + context); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName) { + return beginListAsync(resourceGroupName, virtualWanName).getSyncPoller(); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationsResponseInner> beginList( + String resourceGroupName, String virtualWanName, Context context) { + return beginListAsync(resourceGroupName, virtualWanName, context).getSyncPoller(); + } + + /** + * Gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurations list associated with VirtualWan Response 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..99749622430f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsAssociatedWithVirtualWansClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsAssociatedWithVirtualWans; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnServerConfigurationsAssociatedWithVirtualWansImpl + implements VpnServerConfigurationsAssociatedWithVirtualWans { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsAssociatedWithVirtualWansImpl.class); + + private final VpnServerConfigurationsAssociatedWithVirtualWansClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnServerConfigurationsAssociatedWithVirtualWansImpl( + VpnServerConfigurationsAssociatedWithVirtualWansClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName) { + VpnServerConfigurationsResponseInner inner = this.serviceClient().list(resourceGroupName, virtualWanName); + if (inner != null) { + return new VpnServerConfigurationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public VpnServerConfigurationsResponse list(String resourceGroupName, String virtualWanName, Context context) { + VpnServerConfigurationsResponseInner inner = + this.serviceClient().list(resourceGroupName, virtualWanName, context); + if (inner != null) { + return new VpnServerConfigurationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private VpnServerConfigurationsAssociatedWithVirtualWansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java new file mode 100644 index 0000000000000..0ee4950df0e9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java @@ -0,0 +1,1538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ListVpnServerConfigurationsResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnServerConfigurationsClient. */ +public final class VpnServerConfigurationsClientImpl implements VpnServerConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnServerConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnServerConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnServerConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnServerConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnServerConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnServerConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnServerConfigurationInner vpnServerConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnServerConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations/{vpnServerConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/vpnServerConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + return getByResourceGroupAsync(resourceGroupName, vpnServerConfigurationName).block(); + } + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnServerConfigurationName, context).block(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnServerConfigurationName, + apiVersion, + vpnServerConfigurationParameters, + accept, + context); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) + .getSyncPoller(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, context) + .getSyncPoller(); + } + + /** + * Creates a VpnServerConfiguration resource if it doesn't exist else updates the existing VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being created or updated. + * @param vpnServerConfigurationParameters Parameters supplied to create or update VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationInner updateTags( + String resourceGroupName, String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) { + return updateTagsAsync(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters).block(); + } + + /** + * Updates VpnServerConfiguration tags. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. + * @param vpnServerConfigurationParameters Parameters supplied to update VpnServerConfiguration tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName).getSyncPoller(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, context).getSyncPoller(); + } + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..0b86f2a69e75d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnServerConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnServerConfigurationsImpl implements VpnServerConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigurationsImpl.class); + + private final VpnServerConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnServerConfigurationsImpl( + VpnServerConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnServerConfiguration getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + VpnServerConfigurationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, vpnServerConfigurationName); + if (inner != null) { + return new VpnServerConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnServerConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String vpnServerConfigurationName) { + this.serviceClient().delete(resourceGroupName, vpnServerConfigurationName); + } + + public void delete(String resourceGroupName, String vpnServerConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, vpnServerConfigurationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public VpnServerConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = Utils.getValueFromIdByName(id, "vpnServerConfigurations"); + if (vpnServerConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vpnServerConfigurations'.", + id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, context); + } + + private VpnServerConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnServerConfigurationImpl define(String name) { + return new VpnServerConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java new file mode 100644 index 0000000000000..0e4c654761afa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationsResponseInner; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationsResponse; +import java.util.Collections; +import java.util.List; + +public final class VpnServerConfigurationsResponseImpl implements VpnServerConfigurationsResponse { + private VpnServerConfigurationsResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnServerConfigurationsResponseImpl( + VpnServerConfigurationsResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List vpnServerConfigurationResourceIds() { + List inner = this.innerModel().vpnServerConfigurationResourceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnServerConfigurationsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java new file mode 100644 index 0000000000000..0ceefd8235358 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.DeviceProperties; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VpnSite; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class VpnSiteImpl implements VpnSite, VpnSite.Definition, VpnSite.Update { + private VpnSiteInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 VpnSiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vpnSiteName; + + private TagsObject updateVpnSiteParameters; + + public VpnSiteImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VpnSite create() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .createOrUpdate(resourceGroupName, vpnSiteName, this.innerModel(), Context.NONE); + return this; + } + + public VpnSite create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .createOrUpdate(resourceGroupName, vpnSiteName, this.innerModel(), context); + return this; + } + + VpnSiteImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnSiteInner(); + this.serviceManager = serviceManager; + this.vpnSiteName = name; + } + + public VpnSiteImpl update() { + this.updateVpnSiteParameters = new TagsObject(); + return this; + } + + public VpnSite apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .updateTagsWithResponse(resourceGroupName, vpnSiteName, updateVpnSiteParameters, Context.NONE) + .getValue(); + return this; + } + + public VpnSite apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .updateTagsWithResponse(resourceGroupName, vpnSiteName, updateVpnSiteParameters, context) + .getValue(); + return this; + } + + VpnSiteImpl(VpnSiteInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnSiteName = Utils.getValueFromIdByName(innerObject.id(), "vpnSites"); + } + + public VpnSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE) + .getValue(); + return this; + } + + public VpnSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVpnSites() + .getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context) + .getValue(); + return this; + } + + public VpnSiteImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VpnSiteImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VpnSiteImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVpnSiteParameters.withTags(tags); + return this; + } + } + + public VpnSiteImpl withVirtualWan(SubResource virtualWan) { + this.innerModel().withVirtualWan(virtualWan); + return this; + } + + public VpnSiteImpl withDeviceProperties(DeviceProperties deviceProperties) { + this.innerModel().withDeviceProperties(deviceProperties); + return this; + } + + public VpnSiteImpl withIpAddress(String ipAddress) { + this.innerModel().withIpAddress(ipAddress); + return this; + } + + public VpnSiteImpl withSiteKey(String siteKey) { + this.innerModel().withSiteKey(siteKey); + return this; + } + + public VpnSiteImpl withAddressSpace(AddressSpace addressSpace) { + this.innerModel().withAddressSpace(addressSpace); + return this; + } + + public VpnSiteImpl withBgpProperties(BgpSettings bgpProperties) { + this.innerModel().withBgpProperties(bgpProperties); + return this; + } + + public VpnSiteImpl withIsSecuritySite(Boolean isSecuritySite) { + this.innerModel().withIsSecuritySite(isSecuritySite); + return this; + } + + public VpnSiteImpl withVpnSiteLinks(List vpnSiteLinks) { + this.innerModel().withVpnSiteLinks(vpnSiteLinks); + return this; + } + + public VpnSiteImpl withO365Policy(O365PolicyProperties o365Policy) { + this.innerModel().withO365Policy(o365Policy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java new file mode 100644 index 0000000000000..fe0eaad7342b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnConnectionStatus; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import java.util.Collections; +import java.util.List; + +public final class VpnSiteLinkConnectionImpl implements VpnSiteLinkConnection { + private VpnSiteLinkConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnSiteLinkConnectionImpl( + VpnSiteLinkConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String type() { + return this.innerModel().type(); + } + + public SubResource vpnSiteLink() { + return this.innerModel().vpnSiteLink(); + } + + public Integer routingWeight() { + return this.innerModel().routingWeight(); + } + + public VpnLinkConnectionMode vpnLinkConnectionMode() { + return this.innerModel().vpnLinkConnectionMode(); + } + + public VpnConnectionStatus connectionStatus() { + return this.innerModel().connectionStatus(); + } + + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerModel().vpnConnectionProtocolType(); + } + + public Long ingressBytesTransferred() { + return this.innerModel().ingressBytesTransferred(); + } + + public Long egressBytesTransferred() { + return this.innerModel().egressBytesTransferred(); + } + + public Integer connectionBandwidth() { + return this.innerModel().connectionBandwidth(); + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public Boolean enableBgp() { + return this.innerModel().enableBgp(); + } + + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerModel().usePolicyBasedTrafficSelectors(); + } + + public List ipsecPolicies() { + List inner = this.innerModel().ipsecPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableRateLimiting() { + return this.innerModel().enableRateLimiting(); + } + + public Boolean useLocalAzureIpAddress() { + return this.innerModel().useLocalAzureIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List ingressNatRules() { + List inner = this.innerModel().ingressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List egressNatRules() { + List inner = this.innerModel().egressNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VpnSiteLinkConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java new file mode 100644 index 0000000000000..8a633af8c16fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinkConnectionsClient. */ +public final class VpnSiteLinkConnectionsClientImpl implements VpnSiteLinkConnectionsClient { + private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSiteLinkConnectionsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSiteLinkConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSiteLinkConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnSiteLinkConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSiteLinkConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSiteLinkConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" + + "/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("gatewayName") String gatewayName, + @PathParam("connectionName") String connectionName, + @PathParam("linkConnectionName") String linkConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteLinkConnectionInner get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + return getAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName).block(); + } + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource 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(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java new file mode 100644 index 0000000000000..e542c1fced175 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSiteLinkConnectionsImpl implements VpnSiteLinkConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinkConnectionsImpl.class); + + private final VpnSiteLinkConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSiteLinkConnectionsImpl( + VpnSiteLinkConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSiteLinkConnection get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName) { + VpnSiteLinkConnectionInner inner = + this.serviceClient().get(resourceGroupName, gatewayName, connectionName, linkConnectionName); + if (inner != null) { + return new VpnSiteLinkConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteLinkConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private VpnSiteLinkConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java new file mode 100644 index 0000000000000..ec8629f491cb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; + +public final class VpnSiteLinkImpl implements VpnSiteLink { + private VpnSiteLinkInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VpnSiteLinkImpl( + VpnSiteLinkInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VpnLinkProviderProperties linkProperties() { + return this.innerModel().linkProperties(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public VpnLinkBgpSettings bgpProperties() { + return this.innerModel().bgpProperties(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VpnSiteLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java new file mode 100644 index 0000000000000..aa3459633ce7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSiteLinksResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSiteLinksClient. */ +public final class VpnSiteLinksClientImpl implements VpnSiteLinksClient { + private final ClientLogger logger = new ClientLogger(VpnSiteLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSiteLinksService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSiteLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSiteLinksClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(VpnSiteLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSiteLinks to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSiteLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @PathParam("vpnSiteLinkName") String vpnSiteLinkName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}/vpnSiteLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnSite( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnSiteNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteLinkInner get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + return getAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName).block(); + } + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnSite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnSiteAsync(String resourceGroupName, String vpnSiteName) { + return new PagedFlux<>( + () -> listByVpnSiteSinglePageAsync(resourceGroupName, vpnSiteName), + nextLink -> listByVpnSiteNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnSiteAsync( + String resourceGroupName, String vpnSiteName, Context context) { + return new PagedFlux<>( + () -> listByVpnSiteSinglePageAsync(resourceGroupName, vpnSiteName, context), + nextLink -> listByVpnSiteNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName) { + return new PagedIterable<>(listByVpnSiteAsync(resourceGroupName, vpnSiteName)); + } + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnSite( + String resourceGroupName, String vpnSiteName, Context context) { + return new PagedIterable<>(listByVpnSiteAsync(resourceGroupName, vpnSiteName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..935542d9b0b35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSiteLinksClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.VpnSiteLink; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSiteLinksImpl implements VpnSiteLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSiteLinksImpl.class); + + private final VpnSiteLinksClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSiteLinksImpl( + VpnSiteLinksClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSiteLink get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + VpnSiteLinkInner inner = this.serviceClient().get(resourceGroupName, vpnSiteName, vpnSiteLinkName); + if (inner != null) { + return new VpnSiteLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vpnSiteName, vpnSiteLinkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName) { + PagedIterable inner = this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context) { + PagedIterable inner = + this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteLinkImpl(inner1, this.manager())); + } + + private VpnSiteLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.java new file mode 100644 index 0000000000000..919cf45c8aa5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.ListVpnSitesResult; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSitesClient. */ +public final class VpnSitesClientImpl implements VpnSitesClient { + private final ClientLogger logger = new ClientLogger(VpnSitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSitesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSitesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(VpnSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSites to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSitesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnSiteInner vpnSiteParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject vpnSiteParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" + + "/{vpnSiteName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnSiteName") String vpnSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner getByResourceGroup(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupAsync(resourceGroupName, vpnSiteName).block(); + } + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName, context).block(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vpnSiteName, + apiVersion, + vpnSiteParameters, + accept, + context); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).getSyncPoller(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate( + String resourceGroupName, String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnSiteName, vpnSiteParameters, context).getSyncPoller(); + } + + /** + * Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being created or updated. + * @param vpnSiteParameters Parameters supplied to create or update VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { + return updateTagsAsync(resourceGroupName, vpnSiteName, vpnSiteParameters).block(); + } + + /** + * Updates VpnSite tags. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being updated. + * @param vpnSiteParameters Parameters supplied to update VpnSite tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName) { + return beginDeleteAsync(resourceGroupName, vpnSiteName).getSyncPoller(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String vpnSiteName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnSiteName, context).getSyncPoller(); + } + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the VpnSites in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..a07a2584fc993 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VpnSitesConfigurationsClient. */ +public final class VpnSitesConfigurationsClientImpl implements VpnSitesConfigurationsClient { + private final ClientLogger logger = new ClientLogger(VpnSitesConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VpnSitesConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VpnSitesConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VpnSitesConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create(VpnSitesConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVpnSitesConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface VpnSitesConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" + + "/{virtualWANName}/vpnConfiguration") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> download( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualWANName") String virtualWanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetVpnSitesConfigurationRequest request, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request).getSyncPoller(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDownload( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + return beginDownloadAsync(resourceGroupName, virtualWanName, request, context).getSyncPoller(); + } + + /** + * Gives the sas-url to download the configurations for vpn-sites in a resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which configuration of all vpn-sites is needed. + * @param request Parameters supplied to download vpn-sites configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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..343d0a6735cff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesConfigurationsClient; +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +import com.azure.resourcemanager.network.generated.models.VpnSitesConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSitesConfigurationsImpl implements VpnSitesConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSitesConfigurationsImpl.class); + + private final VpnSitesConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSitesConfigurationsImpl( + VpnSitesConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void download(String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request) { + this.serviceClient().download(resourceGroupName, virtualWanName, request); + } + + public void download( + String resourceGroupName, String virtualWanName, GetVpnSitesConfigurationRequest request, Context context) { + this.serviceClient().download(resourceGroupName, virtualWanName, request, context); + } + + private VpnSitesConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java new file mode 100644 index 0000000000000..0decaf7b39b95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.VpnSitesClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.models.VpnSite; +import com.azure.resourcemanager.network.generated.models.VpnSites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VpnSitesImpl implements VpnSites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnSitesImpl.class); + + private final VpnSitesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VpnSitesImpl( + VpnSitesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public VpnSite getByResourceGroup(String resourceGroupName, String vpnSiteName) { + VpnSiteInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vpnSiteName); + if (inner != null) { + return new VpnSiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnSiteName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VpnSiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String vpnSiteName) { + this.serviceClient().delete(resourceGroupName, vpnSiteName); + } + + public void delete(String resourceGroupName, String vpnSiteName, Context context) { + this.serviceClient().delete(resourceGroupName, vpnSiteName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public VpnSite getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = Utils.getValueFromIdByName(id, "vpnSites"); + if (vpnSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vpnSites'.", id))); + } + this.delete(resourceGroupName, vpnSiteName, context); + } + + private VpnSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnSiteImpl define(String name) { + return new VpnSiteImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java new file mode 100644 index 0000000000000..604ccc0b6420d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java @@ -0,0 +1,1173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebApplicationFirewallPoliciesClient. */ +public final class WebApplicationFirewallPoliciesClientImpl implements WebApplicationFirewallPoliciesClient { + private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WebApplicationFirewallPoliciesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebApplicationFirewallPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebApplicationFirewallPoliciesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy + .create( + WebApplicationFirewallPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientWebApplicationFirewallPolicies to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface WebApplicationFirewallPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WebApplicationFirewallPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network" + + "/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("policyName") String policyName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the WAF policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner getByResourceGroup(String resourceGroupName, String policyName) { + return getByResourceGroupAsync(resourceGroupName, policyName).block(); + } + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block(); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy 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 = "2021-08-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 = "2021-08-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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebApplicationFirewallPolicyInner createOrUpdate( + String resourceGroupName, String policyName, WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, policyName, parameters).block(); + } + + /** + * Creates or update policy with specified rule set name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param parameters Policy to be created. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy 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(); + } + + /** + * 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 = "2021-08-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 = "2021-08-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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String policyName) { + return beginDeleteAsync(resourceGroupName, policyName).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String policyName, Context context) { + return beginDeleteAsync(resourceGroupName, policyName, context).getSyncPoller(); + } + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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..80218dbd1013d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.WebApplicationFirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicies; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WebApplicationFirewallPoliciesImpl implements WebApplicationFirewallPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPoliciesImpl.class); + + private final WebApplicationFirewallPoliciesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public WebApplicationFirewallPoliciesImpl( + WebApplicationFirewallPoliciesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName) { + WebApplicationFirewallPolicyInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, policyName); + if (inner != null) { + return new WebApplicationFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WebApplicationFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String policyName) { + this.serviceClient().delete(resourceGroupName, policyName); + } + + public void delete(String resourceGroupName, String policyName, Context context) { + this.serviceClient().delete(resourceGroupName, policyName, context); + } + + public WebApplicationFirewallPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, policyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName = Utils.getValueFromIdByName(id, "ApplicationGatewayWebApplicationFirewallPolicies"); + if (policyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'ApplicationGatewayWebApplicationFirewallPolicies'.", + id))); + } + this.delete(resourceGroupName, policyName, context); + } + + private WebApplicationFirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public WebApplicationFirewallPolicyImpl define(String name) { + return new WebApplicationFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java new file mode 100644 index 0000000000000..ae9404394cb4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicy; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallPolicyResourceState; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class WebApplicationFirewallPolicyImpl + implements WebApplicationFirewallPolicy, + WebApplicationFirewallPolicy.Definition, + WebApplicationFirewallPolicy.Update { + private WebApplicationFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public 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 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..02eccd443f526 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.WebCategoriesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategoryListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebCategoriesClient. */ +public final class WebCategoriesClientImpl implements WebCategoriesClient { + private final ClientLogger logger = new ClientLogger(WebCategoriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WebCategoriesService service; + + /** The service client containing this operation class. */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of WebCategoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebCategoriesClientImpl(NetworkManagementClientImpl client) { + this.service = + RestProxy.create(WebCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientWebCategories to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + private interface WebCategoriesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), name, apiVersion, this.client.getSubscriptionId(), expand, accept, context); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name, String expand) { + return getWithResponseAsync(name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name) { + final String expand = null; + return getWithResponseAsync(name, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureWebCategoryInner get(String name) { + final String expand = null; + return getAsync(name, expand).block(); + } + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, String expand, Context context) { + return getWithResponseAsync(name, expand, context).block(); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription 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 = "2021-08-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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureWebCategories API service call 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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..36c89b8dac6b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.WebCategoriesClient; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.azure.resourcemanager.network.generated.models.AzureWebCategory; +import com.azure.resourcemanager.network.generated.models.WebCategories; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WebCategoriesImpl implements WebCategories { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebCategoriesImpl.class); + + private final WebCategoriesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public WebCategoriesImpl( + WebCategoriesClient innerClient, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AzureWebCategory get(String name) { + AzureWebCategoryInner inner = this.serviceClient().get(name); + if (inner != null) { + return new AzureWebCategoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String name, String expand, Context context) { + Response inner = this.serviceClient().getWithResponse(name, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureWebCategoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + private WebCategoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java new file mode 100644 index 0000000000000..1af957c3ce12b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.implementation; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java new file mode 100644 index 0000000000000..f131d38664e4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AAD Vpn authentication type related parameters. */ +@Fluent +public final class AadAuthenticationParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AadAuthenticationParameters.class); + + /* + * AAD Vpn authentication parameter AAD tenant. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * AAD Vpn authentication parameter AAD audience. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * AAD Vpn authentication parameter AAD issuer. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /** + * Get the aadTenant property: AAD Vpn authentication parameter AAD tenant. + * + * @return the aadTenant value. + */ + public String aadTenant() { + return this.aadTenant; + } + + /** + * Set the aadTenant property: AAD Vpn authentication parameter AAD tenant. + * + * @param aadTenant the aadTenant value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadTenant(String aadTenant) { + this.aadTenant = aadTenant; + return this; + } + + /** + * Get the aadAudience property: AAD Vpn authentication parameter AAD audience. + * + * @return the aadAudience value. + */ + public String aadAudience() { + return this.aadAudience; + } + + /** + * Set the aadAudience property: AAD Vpn authentication parameter AAD audience. + * + * @param aadAudience the aadAudience value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadAudience(String aadAudience) { + this.aadAudience = aadAudience; + return this; + } + + /** + * Get the aadIssuer property: AAD Vpn authentication parameter AAD issuer. + * + * @return the aadIssuer value. + */ + public String aadIssuer() { + return this.aadIssuer; + } + + /** + * Set the aadIssuer property: AAD Vpn authentication parameter AAD issuer. + * + * @param aadIssuer the aadIssuer value to set. + * @return the AadAuthenticationParameters object itself. + */ + public AadAuthenticationParameters withAadIssuer(String aadIssuer) { + this.aadIssuer = aadIssuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java new file mode 100644 index 0000000000000..9c4ff18411b3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Access. */ +public final class Access extends ExpandableStringEnum { + /** Static value Allow for Access. */ + public static final Access ALLOW = fromString("Allow"); + + /** Static value Deny for Access. */ + public static final Access DENY = fromString("Deny"); + + /** + * Creates or finds a Access from its string representation. + * + * @param name a name to look for. + * @return the corresponding Access. + */ + @JsonCreator + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** @return known Access values. */ + public static Collection values() { + return values(Access.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java new file mode 100644 index 0000000000000..7094963b81261 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. */ +@Fluent +public final class AddressSpace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressSpace.class); + + /* + * A list of address blocks reserved for this virtual network in CIDR + * notation. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /** + * Get the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: A list of address blocks reserved for this virtual network in CIDR notation. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the AddressSpace object itself. + */ + public AddressSpace withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java new file mode 100644 index 0000000000000..372f39f869c46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java @@ -0,0 +1,974 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 httpListeners property: Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the httpListeners value. + */ + List httpListeners(); + + /** + * Gets the sslProfiles property: SSL profiles of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the sslProfiles value. + */ + List sslProfiles(); + + /** + * Gets the urlPathMaps property: URL path map of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the urlPathMaps value. + */ + List urlPathMaps(); + + /** + * Gets the requestRoutingRules property: Request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value. + */ + List requestRoutingRules(); + + /** + * Gets the rewriteRuleSets property: Rewrite rules for the application gateway resource. + * + * @return the rewriteRuleSets value. + */ + List rewriteRuleSets(); + + /** + * Gets the redirectConfigurations property: Redirect configurations of the application gateway resource. For + * default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * + * @return the redirectConfigurations value. + */ + List redirectConfigurations(); + + /** + * Gets the webApplicationFirewallConfiguration property: Web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value. + */ + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration(); + + /** + * Gets the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + SubResource firewallPolicy(); + + /** + * Gets the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource. + * + * @return the enableHttp2 value. + */ + Boolean enableHttp2(); + + /** + * Gets the enableFips property: Whether FIPS is enabled on the application gateway resource. + * + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * Gets the autoscaleConfiguration property: Autoscale Configuration. + * + * @return the autoscaleConfiguration value. + */ + ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration(); + + /** + * Gets the privateLinkConfigurations property: PrivateLink configurations on application gateway. + * + * @return the privateLinkConfigurations value. + */ + List privateLinkConfigurations(); + + /** + * Gets the privateEndpointConnections property: Private Endpoint connections on application gateway. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the resourceGuid property: The resource GUID property of the application gateway resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the application gateway resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the customErrorConfigurations property: Custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value. + */ + List customErrorConfigurations(); + + /** + * Gets the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an application + * gateway regardless whether the policy differs from the WAF Config. + * + * @return the forceFirewallPolicyAssociation value. + */ + Boolean forceFirewallPolicyAssociation(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner object. + * + * @return the inner object. + */ + ApplicationGatewayInner innerModel(); + + /** The entirety of the ApplicationGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ApplicationGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationGateway definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ApplicationGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ApplicationGateway definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithZones, + DefinitionStages.WithIdentity, + DefinitionStages.WithSku, + DefinitionStages.WithSslPolicy, + DefinitionStages.WithGatewayIpConfigurations, + DefinitionStages.WithAuthenticationCertificates, + DefinitionStages.WithTrustedRootCertificates, + DefinitionStages.WithTrustedClientCertificates, + DefinitionStages.WithSslCertificates, + DefinitionStages.WithFrontendIpConfigurations, + DefinitionStages.WithFrontendPorts, + DefinitionStages.WithProbes, + DefinitionStages.WithBackendAddressPools, + DefinitionStages.WithBackendHttpSettingsCollection, + DefinitionStages.WithHttpListeners, + DefinitionStages.WithSslProfiles, + DefinitionStages.WithUrlPathMaps, + DefinitionStages.WithRequestRoutingRules, + DefinitionStages.WithRewriteRuleSets, + DefinitionStages.WithRedirectConfigurations, + DefinitionStages.WithWebApplicationFirewallConfiguration, + DefinitionStages.WithFirewallPolicy, + DefinitionStages.WithEnableHttp2, + DefinitionStages.WithEnableFips, + DefinitionStages.WithAutoscaleConfiguration, + DefinitionStages.WithPrivateLinkConfigurations, + DefinitionStages.WithCustomErrorConfigurations, + DefinitionStages.WithForceFirewallPolicyAssociation, + 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 httpListeners. */ + interface WithHttpListeners { + /** + * Specifies the httpListeners property: Http listeners of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param httpListeners Http listeners of the application gateway resource. For default limits, see + * [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withHttpListeners(List httpListeners); + } + /** The stage of the ApplicationGateway definition allowing to specify sslProfiles. */ + interface WithSslProfiles { + /** + * Specifies the sslProfiles property: SSL profiles of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param sslProfiles SSL profiles of the application gateway resource. For default limits, see [Application + * Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withSslProfiles(List sslProfiles); + } + /** The stage of the ApplicationGateway definition allowing to specify urlPathMaps. */ + interface WithUrlPathMaps { + /** + * Specifies the urlPathMaps property: URL path map of the application gateway resource. For default limits, + * see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param urlPathMaps URL path map of the application gateway resource. For default limits, see [Application + * Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withUrlPathMaps(List urlPathMaps); + } + /** The stage of the ApplicationGateway definition allowing to specify requestRoutingRules. */ + interface WithRequestRoutingRules { + /** + * Specifies the requestRoutingRules property: Request routing rules of the application gateway resource.. + * + * @param requestRoutingRules Request routing rules of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withRequestRoutingRules(List requestRoutingRules); + } + /** The stage of the ApplicationGateway definition allowing to specify rewriteRuleSets. */ + interface WithRewriteRuleSets { + /** + * Specifies the rewriteRuleSets property: Rewrite rules for the application gateway resource.. + * + * @param rewriteRuleSets Rewrite rules for the application gateway resource. + * @return the next definition stage. + */ + WithCreate withRewriteRuleSets(List rewriteRuleSets); + } + /** The stage of the ApplicationGateway definition allowing to specify redirectConfigurations. */ + interface WithRedirectConfigurations { + /** + * Specifies the redirectConfigurations property: Redirect configurations of the application gateway + * resource. For default limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).. + * + * @param redirectConfigurations Redirect configurations of the application gateway resource. For default + * limits, see [Application Gateway + * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). + * @return the next definition stage. + */ + WithCreate withRedirectConfigurations(List redirectConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify webApplicationFirewallConfiguration. */ + interface WithWebApplicationFirewallConfiguration { + /** + * Specifies the webApplicationFirewallConfiguration property: Web application firewall configuration.. + * + * @param webApplicationFirewallConfiguration Web application firewall configuration. + * @return the next definition stage. + */ + WithCreate withWebApplicationFirewallConfiguration( + ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration); + } + /** The stage of the ApplicationGateway definition allowing to specify firewallPolicy. */ + interface WithFirewallPolicy { + /** + * Specifies the firewallPolicy property: Reference to the FirewallPolicy resource.. + * + * @param firewallPolicy Reference to the FirewallPolicy resource. + * @return the next definition stage. + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** The stage of the ApplicationGateway definition allowing to specify enableHttp2. */ + interface WithEnableHttp2 { + /** + * Specifies the enableHttp2 property: Whether HTTP2 is enabled on the application gateway resource.. + * + * @param enableHttp2 Whether HTTP2 is enabled on the application gateway resource. + * @return the next definition stage. + */ + WithCreate withEnableHttp2(Boolean enableHttp2); + } + /** The stage of the ApplicationGateway definition allowing to specify enableFips. */ + interface WithEnableFips { + /** + * Specifies the enableFips property: Whether FIPS is enabled on the application gateway resource.. + * + * @param enableFips Whether FIPS is enabled on the application gateway resource. + * @return the next definition stage. + */ + WithCreate withEnableFips(Boolean enableFips); + } + /** The stage of the ApplicationGateway definition allowing to specify autoscaleConfiguration. */ + interface WithAutoscaleConfiguration { + /** + * Specifies the autoscaleConfiguration property: Autoscale Configuration.. + * + * @param autoscaleConfiguration Autoscale Configuration. + * @return the next definition stage. + */ + WithCreate withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration); + } + /** The stage of the ApplicationGateway definition allowing to specify privateLinkConfigurations. */ + interface WithPrivateLinkConfigurations { + /** + * Specifies the privateLinkConfigurations property: PrivateLink configurations on application gateway.. + * + * @param privateLinkConfigurations PrivateLink configurations on application gateway. + * @return the next definition stage. + */ + WithCreate withPrivateLinkConfigurations( + List privateLinkConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify customErrorConfigurations. */ + interface WithCustomErrorConfigurations { + /** + * Specifies the customErrorConfigurations property: Custom error configurations of the application gateway + * resource.. + * + * @param customErrorConfigurations Custom error configurations of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withCustomErrorConfigurations(List customErrorConfigurations); + } + /** The stage of the ApplicationGateway definition allowing to specify forceFirewallPolicyAssociation. */ + interface WithForceFirewallPolicyAssociation { + /** + * Specifies the forceFirewallPolicyAssociation property: If true, associates a firewall policy with an + * application gateway regardless whether the policy differs from the WAF Config.. + * + * @param forceFirewallPolicyAssociation If true, associates a firewall policy with an application gateway + * regardless whether the policy differs from the WAF Config. + * @return the next definition stage. + */ + WithCreate withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation); + } + /** 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. + * + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand(ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java new file mode 100644 index 0000000000000..ad257c37c0350 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAuthenticationCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAuthenticationCertificate.class); + + /* + * 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; + + /** + * 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..2cdccb0dde0e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Gateway autoscale configuration. */ +@Fluent +public final class ApplicationGatewayAutoscaleConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayAutoscaleConfiguration.class); + + /* + * Lower bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "minCapacity", required = true) + private int minCapacity; + + /* + * Upper bound on number of Application Gateway capacity. + */ + @JsonProperty(value = "maxCapacity") + private Integer maxCapacity; + + /** + * Get the minCapacity property: Lower bound on number of Application Gateway capacity. + * + * @return the minCapacity value. + */ + public int minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: Lower bound on number of Application Gateway capacity. + * + * @param minCapacity the minCapacity value to set. + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withMinCapacity(int minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the maxCapacity property: Upper bound on number of Application Gateway capacity. + * + * @return the maxCapacity value. + */ + public Integer maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity property: Upper bound on number of Application Gateway capacity. + * + * @param maxCapacity the maxCapacity value to set. + * @return the ApplicationGatewayAutoscaleConfiguration object itself. + */ + public ApplicationGatewayAutoscaleConfiguration withMaxCapacity(Integer maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.java new file mode 100644 index 0000000000000..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..5d5ff873a9ddf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ApplicationGatewayAvailableSslOptions API service call. */ +@Fluent +public final class ApplicationGatewayAvailableSslPredefinedPolicies { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayAvailableSslPredefinedPolicies.class); + + /* + * List of available Ssl predefined policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of available Ssl predefined policy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of available Ssl predefined policy. + * + * @param value the value value to set. + * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. + */ + public ApplicationGatewayAvailableSslPredefinedPolicies withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayAvailableSslPredefinedPolicies object itself. + */ + public ApplicationGatewayAvailableSslPredefinedPolicies withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java new file mode 100644 index 0000000000000..0c5a08586e750 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewayAvailableWafRuleSetsResult. */ +public interface ApplicationGatewayAvailableWafRuleSetsResult { + /** + * Gets the value property: The list of application gateway rule sets. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayAvailableWafRuleSetsResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java new file mode 100644 index 0000000000000..ea5efe8b7075b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backend address of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddress.class); + + /* + * Fully qualified domain name (FQDN). + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /** + * Get the fqdn property: Fully qualified domain name (FQDN). + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fully qualified domain name (FQDN). + * + * @param fqdn the fqdn value to set. + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the ipAddress property: IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the ApplicationGatewayBackendAddress object itself. + */ + public ApplicationGatewayBackendAddress withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java new file mode 100644 index 0000000000000..62567f3872ab0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendAddressPoolPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Backend Address Pool of an application gateway. */ +@Fluent +public final class ApplicationGatewayBackendAddressPool extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendAddressPool.class); + + /* + * 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; + + /** + * 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..ea1e24e383eb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway BackendHealthHttp settings. */ +@Fluent +public final class ApplicationGatewayBackendHealthHttpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthHttpSettings.class); + + /* + * Reference to an ApplicationGatewayBackendHttpSettings resource. + */ + @JsonProperty(value = "backendHttpSettings") + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /* + * List of ApplicationGatewayBackendHealthServer resources. + */ + @JsonProperty(value = "servers") + private List servers; + + /** + * Get the backendHttpSettings property: Reference to an ApplicationGatewayBackendHttpSettings resource. + * + * @return the backendHttpSettings value. + */ + public ApplicationGatewayBackendHttpSettings backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Reference to an ApplicationGatewayBackendHttpSettings resource. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withBackendHttpSettings( + ApplicationGatewayBackendHttpSettings backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Get the servers property: List of ApplicationGatewayBackendHealthServer resources. + * + * @return the servers value. + */ + public List servers() { + return this.servers; + } + + /** + * Set the servers property: List of ApplicationGatewayBackendHealthServer resources. + * + * @param servers the servers value to set. + * @return the ApplicationGatewayBackendHealthHttpSettings object itself. + */ + public ApplicationGatewayBackendHealthHttpSettings withServers( + List servers) { + this.servers = servers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendHttpSettings() != null) { + backendHttpSettings().validate(); + } + if (servers() != null) { + servers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java new file mode 100644 index 0000000000000..890d6baacbd45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthOnDemand. */ +public interface ApplicationGatewayBackendHealthOnDemand { + /** + * Gets the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + ApplicationGatewayBackendAddressPool backendAddressPool(); + + /** + * Gets the backendHealthHttpSettings property: Application gateway BackendHealthHttp settings. + * + * @return the backendHealthHttpSettings value. + */ + ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthOnDemandInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthOnDemandInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java new file mode 100644 index 0000000000000..8b427bb340ad8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway BackendHealth pool. */ +@Fluent +public final class ApplicationGatewayBackendHealthPool { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHealthPool.class); + + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + @JsonProperty(value = "backendAddressPool") + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + @JsonProperty(value = "backendHttpSettingsCollection") + private List backendHttpSettingsCollection; + + /** + * Get the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public ApplicationGatewayBackendAddressPool backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to an ApplicationGatewayBackendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendAddressPool( + ApplicationGatewayBackendAddressPool backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @return the backendHttpSettingsCollection value. + */ + public List backendHttpSettingsCollection() { + return this.backendHttpSettingsCollection; + } + + /** + * Set the backendHttpSettingsCollection property: List of ApplicationGatewayBackendHealthHttpSettings resources. + * + * @param backendHttpSettingsCollection the backendHttpSettingsCollection value to set. + * @return the ApplicationGatewayBackendHealthPool object itself. + */ + public ApplicationGatewayBackendHealthPool withBackendHttpSettingsCollection( + List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendAddressPool() != null) { + backendAddressPool().validate(); + } + if (backendHttpSettingsCollection() != null) { + backendHttpSettingsCollection().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java new file mode 100644 index 0000000000000..f0aa53696f06c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; + +/** An immutable client-side representation of ApplicationGatewayBackendHealthServer. */ +public interface ApplicationGatewayBackendHealthServer { + /** + * Gets the address property: IP address or FQDN of backend server. + * + * @return the address value. + */ + String address(); + + /** + * Gets the ipConfiguration property: Reference to IP configuration of backend server. + * + * @return the ipConfiguration value. + */ + NetworkInterfaceIpConfiguration ipConfiguration(); + + /** + * Gets the health property: Health of backend server. + * + * @return the health value. + */ + ApplicationGatewayBackendHealthServerHealth health(); + + /** + * Gets the healthProbeLog property: Health Probe Log. + * + * @return the healthProbeLog value. + */ + String healthProbeLog(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner object. + * + * @return the inner object. + */ + ApplicationGatewayBackendHealthServerInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java new file mode 100644 index 0000000000000..b18a8b030fab6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayBackendHealthServerHealth. */ +public final class ApplicationGatewayBackendHealthServerHealth + extends ExpandableStringEnum { + /** Static value Unknown for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UNKNOWN = fromString("Unknown"); + + /** Static value Up for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth UP = fromString("Up"); + + /** Static value Down for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DOWN = fromString("Down"); + + /** Static value Partial for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth PARTIAL = fromString("Partial"); + + /** Static value Draining for ApplicationGatewayBackendHealthServerHealth. */ + public static final ApplicationGatewayBackendHealthServerHealth DRAINING = fromString("Draining"); + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayBackendHealthServerHealth. + */ + @JsonCreator + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** @return known ApplicationGatewayBackendHealthServerHealth values. */ + public static Collection values() { + return values(ApplicationGatewayBackendHealthServerHealth.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java new file mode 100644 index 0000000000000..4b75bd75f1022 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.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.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.ApplicationGatewayBackendHttpSettingsPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayBackendHttpSettings.class); + + /* + * 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; + + /** + * 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/ApplicationGatewayClientAuthConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.java new file mode 100644 index 0000000000000..3634d3838d4d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application gateway client authentication configuration. */ +@Fluent +public final class ApplicationGatewayClientAuthConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayClientAuthConfiguration.class); + + /* + * Verify client certificate issuer name on the application gateway. + */ + @JsonProperty(value = "verifyClientCertIssuerDN") + private Boolean verifyClientCertIssuerDN; + + /** + * Get the verifyClientCertIssuerDN property: Verify client certificate issuer name on the application gateway. + * + * @return the verifyClientCertIssuerDN value. + */ + public Boolean verifyClientCertIssuerDN() { + return this.verifyClientCertIssuerDN; + } + + /** + * Set the verifyClientCertIssuerDN property: Verify client certificate issuer name on the application gateway. + * + * @param verifyClientCertIssuerDN the verifyClientCertIssuerDN value to set. + * @return the ApplicationGatewayClientAuthConfiguration object itself. + */ + public ApplicationGatewayClientAuthConfiguration withVerifyClientCertIssuerDN(Boolean verifyClientCertIssuerDN) { + this.verifyClientCertIssuerDN = verifyClientCertIssuerDN; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java new file mode 100644 index 0000000000000..320c4f8d3e2b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection draining allows open connections to a backend server to be active for a specified time after the backend + * server got removed from the configuration. + */ +@Fluent +public final class ApplicationGatewayConnectionDraining { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayConnectionDraining.class); + + /* + * Whether connection draining is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The number of seconds connection draining is active. Acceptable values + * are from 1 second to 3600 seconds. + */ + @JsonProperty(value = "drainTimeoutInSec", required = true) + private int drainTimeoutInSec; + + /** + * Get the enabled property: Whether connection draining is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether connection draining is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are + * from 1 second to 3600 seconds. + * + * @return the drainTimeoutInSec value. + */ + public int drainTimeoutInSec() { + return this.drainTimeoutInSec; + } + + /** + * Set the drainTimeoutInSec property: The number of seconds connection draining is active. Acceptable values are + * from 1 second to 3600 seconds. + * + * @param drainTimeoutInSec the drainTimeoutInSec value to set. + * @return the ApplicationGatewayConnectionDraining object itself. + */ + public ApplicationGatewayConnectionDraining withDrainTimeoutInSec(int drainTimeoutInSec) { + this.drainTimeoutInSec = drainTimeoutInSec; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java new file mode 100644 index 0000000000000..79535131e4562 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayCookieBasedAffinity. */ +public final class ApplicationGatewayCookieBasedAffinity + extends ExpandableStringEnum { + /** Static value Enabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity ENABLED = fromString("Enabled"); + + /** Static value Disabled for ApplicationGatewayCookieBasedAffinity. */ + public static final ApplicationGatewayCookieBasedAffinity DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCookieBasedAffinity. + */ + @JsonCreator + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** @return known ApplicationGatewayCookieBasedAffinity values. */ + public static Collection values() { + return values(ApplicationGatewayCookieBasedAffinity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java new file mode 100644 index 0000000000000..a5447bf727762 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customer error of an application gateway. */ +@Fluent +public final class ApplicationGatewayCustomError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayCustomError.class); + + /* + * Status code of the application gateway customer error. + */ + @JsonProperty(value = "statusCode") + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /* + * Error page URL of the application gateway customer error. + */ + @JsonProperty(value = "customErrorPageUrl") + private String customErrorPageUrl; + + /** + * Get the statusCode property: Status code of the application gateway customer error. + * + * @return the statusCode value. + */ + public ApplicationGatewayCustomErrorStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: Status code of the application gateway customer error. + * + * @param statusCode the statusCode value to set. + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withStatusCode(ApplicationGatewayCustomErrorStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the customErrorPageUrl property: Error page URL of the application gateway customer error. + * + * @return the customErrorPageUrl value. + */ + public String customErrorPageUrl() { + return this.customErrorPageUrl; + } + + /** + * Set the customErrorPageUrl property: Error page URL of the application gateway customer error. + * + * @param customErrorPageUrl the customErrorPageUrl value to set. + * @return the ApplicationGatewayCustomError object itself. + */ + public ApplicationGatewayCustomError withCustomErrorPageUrl(String customErrorPageUrl) { + this.customErrorPageUrl = customErrorPageUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java new file mode 100644 index 0000000000000..6f0bd2d98ef78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayCustomErrorStatusCode. */ +public final class ApplicationGatewayCustomErrorStatusCode + extends ExpandableStringEnum { + /** Static value HttpStatus403 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS403 = fromString("HttpStatus403"); + + /** Static value HttpStatus502 for ApplicationGatewayCustomErrorStatusCode. */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS502 = fromString("HttpStatus502"); + + /** + * Creates or finds a ApplicationGatewayCustomErrorStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCustomErrorStatusCode. + */ + @JsonCreator + public static ApplicationGatewayCustomErrorStatusCode fromString(String name) { + return fromString(name, ApplicationGatewayCustomErrorStatusCode.class); + } + + /** @return known ApplicationGatewayCustomErrorStatusCode values. */ + public static Collection values() { + return values(ApplicationGatewayCustomErrorStatusCode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java new file mode 100644 index 0000000000000..bdbbc5d26cd88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allows to disable rules within a rule group or an entire rule group. */ +@Fluent +public final class ApplicationGatewayFirewallDisabledRuleGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallDisabledRuleGroup.class); + + /* + * The name of the rule group that will be disabled. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The list of rules that will be disabled. If null, all rules of the rule + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the ruleGroupName property: The name of the rule group that will be disabled. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The name of the rule group that will be disabled. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The list of rules that will be disabled. If null, all rules of the rule group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ApplicationGatewayFirewallDisabledRuleGroup object itself. + */ + public ApplicationGatewayFirewallDisabledRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model" + + " ApplicationGatewayFirewallDisabledRuleGroup")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java new file mode 100644 index 0000000000000..c3675b672bf20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ApplicationGatewayFirewallExclusion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallExclusion.class); + + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private String matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private String selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /** + * Get the matchVariable property: The variable to be excluded. + * + * @return the matchVariable value. + */ + public String matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable to be excluded. + * + * @param matchVariable the matchVariable value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withMatchVariable(String matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @return the selectorMatchOperator value. + */ + public String selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelectorMatchOperator(String selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: When matchVariable is a collection, operator used to specify which elements in the + * collection this exclusion applies to. + * + * @param selector the selector value to set. + * @return the ApplicationGatewayFirewallExclusion object itself. + */ + public ApplicationGatewayFirewallExclusion withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchVariable in model ApplicationGatewayFirewallExclusion")); + } + if (selectorMatchOperator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectorMatchOperator in model" + + " ApplicationGatewayFirewallExclusion")); + } + if (selector() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selector in model ApplicationGatewayFirewallExclusion")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java new file mode 100644 index 0000000000000..3a8bde59b609a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayFirewallMode. */ +public final class ApplicationGatewayFirewallMode extends ExpandableStringEnum { + /** Static value Detection for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode DETECTION = fromString("Detection"); + + /** Static value Prevention for ApplicationGatewayFirewallMode. */ + public static final ApplicationGatewayFirewallMode PREVENTION = fromString("Prevention"); + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayFirewallMode. + */ + @JsonCreator + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** @return known ApplicationGatewayFirewallMode values. */ + public static Collection values() { + return values(ApplicationGatewayFirewallMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java new file mode 100644 index 0000000000000..c4f2f32f85547 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A web application firewall rule. */ +@Fluent +public final class ApplicationGatewayFirewallRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRule.class); + + /* + * The identifier of the web application firewall rule. + */ + @JsonProperty(value = "ruleId", required = true) + private int ruleId; + + /* + * The description of the web application firewall rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the ruleId property: The identifier of the web application firewall rule. + * + * @return the ruleId value. + */ + public int ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: The identifier of the web application firewall rule. + * + * @param ruleId the ruleId value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleId(int ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description property: The description of the web application firewall rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the web application firewall rule. + * + * @param description the description value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java new file mode 100644 index 0000000000000..beacd6ac2f0cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A web application firewall rule group. */ +@Fluent +public final class ApplicationGatewayFirewallRuleGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleGroup.class); + + /* + * The name of the web application firewall rule group. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * The description of the web application firewall rule group. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rules of the web application firewall rule group. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the ruleGroupName property: The name of the web application firewall rule group. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The name of the web application firewall rule group. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the description property: The description of the web application firewall rule group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the web application firewall rule group. + * + * @param description the description value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rules property: The rules of the web application firewall rule group. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The rules of the web application firewall rule group. + * + * @param rules the rules value to set. + * @return the ApplicationGatewayFirewallRuleGroup object itself. + */ + public ApplicationGatewayFirewallRuleGroup withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ApplicationGatewayFirewallRuleGroup")); + } + if (rules() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rules in model ApplicationGatewayFirewallRuleGroup")); + } else { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.java new file mode 100644 index 0000000000000..77836d8c16efa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.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.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFirewallRuleSetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A web application firewall rule set. */ +@Fluent +public final class ApplicationGatewayFirewallRuleSet extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFirewallRuleSet.class); + + /* + * Properties of the application gateway firewall rule set. + */ + @JsonProperty(value = "properties") + private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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; + } + + /** + * 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..f397c6f39a4ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend IP configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendIpConfiguration.class); + + /* + * 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; + + /** + * 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..96bd146a69329 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendPortPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Frontend port of an application gateway. */ +@Fluent +public final class ApplicationGatewayFrontendPort extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayFrontendPort.class); + + /* + * 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; + + /** + * 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..10cf8ca536cc1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Gateway global configuration. */ +@Fluent +public final class ApplicationGatewayGlobalConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayGlobalConfiguration.class); + + /* + * Enable request buffering. + */ + @JsonProperty(value = "enableRequestBuffering") + private Boolean enableRequestBuffering; + + /* + * Enable response buffering. + */ + @JsonProperty(value = "enableResponseBuffering") + private Boolean enableResponseBuffering; + + /** + * 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..f01c85ad92d56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Header configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayHeaderConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHeaderConfiguration.class); + + /* + * Header name of the header configuration. + */ + @JsonProperty(value = "headerName") + private String headerName; + + /* + * Header value of the header configuration. + */ + @JsonProperty(value = "headerValue") + private String headerValue; + + /** + * Get the headerName property: Header name of the header configuration. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: Header name of the header configuration. + * + * @param headerName the headerName value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the headerValue property: Header value of the header configuration. + * + * @return the headerValue value. + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set the headerValue property: Header value of the header configuration. + * + * @param headerValue the headerValue value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderValue(String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java new file mode 100644 index 0000000000000..5234014b3c475 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayHttpListenerPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Http listener of an application gateway. */ +@Fluent +public final class ApplicationGatewayHttpListener extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayHttpListener.class); + + /* + * 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; + + /** + * 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..7e5a61e2f4c4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. */ +@Fluent +public final class ApplicationGatewayIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayIpConfiguration.class); + + /* + * 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; + + /** + * 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..3ec8d018bb63f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListApplicationGateways API service call. */ +@Fluent +public final class ApplicationGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayListResult.class); + + /* + * List of an application gateways in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of an application gateways in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of an application gateways in a resource group. + * + * @param value the value value to set. + * @return the ApplicationGatewayListResult object itself. + */ + public ApplicationGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayListResult object itself. + */ + public ApplicationGatewayListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..9f42d978cf91d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayLoadDistributionAlgorithm. */ +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 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); + } + + /** @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..3572548bf4491 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionPolicyPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Load Distribution Policy of an application gateway. */ +@Fluent +public final class ApplicationGatewayLoadDistributionPolicy extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayLoadDistributionPolicy.class); + + /* + * 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; + + /** + * 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..3a993ef69efbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionTargetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Load Distribution Target of an application gateway. */ +@Fluent +public final class ApplicationGatewayLoadDistributionTarget extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayLoadDistributionTarget.class); + + /* + * 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; + + /** + * 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..916aeca5c5f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of on demand test probe request. */ +@Fluent +public final class ApplicationGatewayOnDemandProbe { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayOnDemandProbe.class); + + /* + * The protocol used for the probe. + */ + @JsonProperty(value = "protocol") + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to + * ://:. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The probe timeout in seconds. Probe marked as failed if valid response + * is not received with this timeout period. Acceptable values are from 1 + * second to 86400 seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /* + * Whether the host header should be picked from the backend http settings. + * Default value is false. + */ + @JsonProperty(value = "pickHostNameFromBackendHttpSettings") + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Criterion for classifying a healthy probe response. + */ + @JsonProperty(value = "match") + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * Reference to backend pool of application gateway to which probe request + * will be sent. + */ + @JsonProperty(value = "backendAddressPool") + private SubResource backendAddressPool; + + /* + * Reference to backend http setting of application gateway to be used for + * test probe. + */ + @JsonProperty(value = "backendHttpSettings") + private SubResource backendHttpSettings; + + /** + * Get the protocol property: The protocol used for the probe. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used for the probe. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the host property: Host name to send the probe to. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Host name to send the probe to. + * + * @param host the host value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative path of probe. Valid path starts from '/'. Probe is sent to + * <Protocol>://<host>:<port><path>. + * + * @param path the path value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The probe timeout in seconds. Probe marked as failed if valid response is not received + * with this timeout period. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @return the pickHostnameFromBackendHttpSettings value. + */ + public Boolean pickHostnameFromBackendHttpSettings() { + return this.pickHostnameFromBackendHttpSettings; + } + + /** + * Set the pickHostnameFromBackendHttpSettings property: Whether the host header should be picked from the backend + * http settings. Default value is false. + * + * @param pickHostnameFromBackendHttpSettings the pickHostnameFromBackendHttpSettings value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withPickHostnameFromBackendHttpSettings( + Boolean pickHostnameFromBackendHttpSettings) { + this.pickHostnameFromBackendHttpSettings = pickHostnameFromBackendHttpSettings; + return this; + } + + /** + * Get the match property: Criterion for classifying a healthy probe response. + * + * @return the match value. + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.match; + } + + /** + * Set the match property: Criterion for classifying a healthy probe response. + * + * @param match the match value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withMatch(ApplicationGatewayProbeHealthResponseMatch match) { + this.match = match; + return this; + } + + /** + * Get the backendAddressPool property: Reference to backend pool of application gateway to which probe request will + * be sent. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: Reference to backend pool of application gateway to which probe request will + * be sent. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendHttpSettings property: Reference to backend http setting of application gateway to be used for + * test probe. + * + * @return the backendHttpSettings value. + */ + public SubResource backendHttpSettings() { + return this.backendHttpSettings; + } + + /** + * Set the backendHttpSettings property: Reference to backend http setting of application gateway to be used for + * test probe. + * + * @param backendHttpSettings the backendHttpSettings value to set. + * @return the ApplicationGatewayOnDemandProbe object itself. + */ + public ApplicationGatewayOnDemandProbe withBackendHttpSettings(SubResource backendHttpSettings) { + this.backendHttpSettings = backendHttpSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (match() != null) { + match().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java new file mode 100644 index 0000000000000..dd88f9fceb0e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayOperationalState. */ +public final class ApplicationGatewayOperationalState extends ExpandableStringEnum { + /** Static value Stopped for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPED = fromString("Stopped"); + + /** Static value Starting for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STARTING = fromString("Starting"); + + /** Static value Running for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState RUNNING = fromString("Running"); + + /** Static value Stopping for ApplicationGatewayOperationalState. */ + public static final ApplicationGatewayOperationalState STOPPING = fromString("Stopping"); + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayOperationalState. + */ + @JsonCreator + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** @return known ApplicationGatewayOperationalState values. */ + public static Collection values() { + return values(ApplicationGatewayOperationalState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.java new file mode 100644 index 0000000000000..56a3eb40160fd --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPathRulePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Path rule of URL path map of an application gateway. */ +@Fluent +public final class ApplicationGatewayPathRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPathRule.class); + + /* + * 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; + + /** + * 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..56f67ae15ae64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections + * for an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateEndpointConnectionListResult.class); + + /* + * List of private endpoint connections on an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of private endpoint connections on an application gateway. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of private endpoint connections on an application gateway. + * + * @param value the value value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionListResult object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayPrivateEndpointConnectionListResult object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..8341586d89eef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; + +/** Resource collection API of ApplicationGatewayPrivateEndpointConnections. */ +public interface ApplicationGatewayPrivateEndpointConnections { + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String applicationGatewayName, String connectionName); + + /** + * Deletes the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String applicationGatewayName, String connectionName, Context context); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters); + + /** + * Updates the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param parameters Parameters supplied to update application gateway private endpoint connection operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint connection on an application gateway. + */ + ApplicationGatewayPrivateEndpointConnection update( + String resourceGroupName, + String applicationGatewayName, + String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, + Context context); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway. + */ + ApplicationGatewayPrivateEndpointConnection get( + String resourceGroupName, String applicationGatewayName, String connectionName); + + /** + * Gets the specified private endpoint connection on application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param connectionName The name of the application gateway private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection on application gateway along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String applicationGatewayName, String connectionName, Context context); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private endpoint connections on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java new file mode 100644 index 0000000000000..c05f9b088a40f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private Link Configuration on an application gateway. */ +@Fluent +public final class ApplicationGatewayPrivateLinkConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkConfiguration.class); + + /* + * 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; + + /** + * 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..ce574be981b17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The application gateway private link ip configuration. */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfiguration extends SubResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkIpConfiguration.class); + + /* + * 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; + + /** + * 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..8f146c098b23a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an + * application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayPrivateLinkResourceListResult.class); + + /* + * List of private link resources of an application gateway. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of private link resources of an application gateway. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of private link resources of an application gateway. + * + * @param value the value value to set. + * @return the ApplicationGatewayPrivateLinkResourceListResult object itself. + */ + public ApplicationGatewayPrivateLinkResourceListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationGatewayPrivateLinkResourceListResult object itself. + */ + public ApplicationGatewayPrivateLinkResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java new file mode 100644 index 0000000000000..8970b7468bd5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationGatewayPrivateLinkResources. */ +public interface ApplicationGatewayPrivateLinkResources { + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + PagedIterable list(String resourceGroupName, String applicationGatewayName); + + /** + * Lists all private link resources on an application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call. + */ + PagedIterable list( + String resourceGroupName, String applicationGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java new file mode 100644 index 0000000000000..e5f235134cf89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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.ApplicationGatewayProbePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Probe of the application gateway. */ +@Fluent +public final class ApplicationGatewayProbe extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbe.class); + + /* + * 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; + + /** + * 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 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..8c0334160e188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway probe health response match. */ +@Fluent +public final class ApplicationGatewayProbeHealthResponseMatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayProbeHealthResponseMatch.class); + + /* + * Body that must be contained in the health response. Default value is + * empty. + */ + @JsonProperty(value = "body") + private String body; + + /* + * Allowed ranges of healthy status codes. Default range of healthy status + * codes is 200-399. + */ + @JsonProperty(value = "statusCodes") + private List statusCodes; + + /** + * Get the body property: Body that must be contained in the health response. Default value is empty. + * + * @return the body value. + */ + public String body() { + return this.body; + } + + /** + * Set the body property: Body that must be contained in the health response. Default value is empty. + * + * @param body the body value to set. + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withBody(String body) { + this.body = body; + return this; + } + + /** + * Get the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is + * 200-399. + * + * @return the statusCodes value. + */ + public List statusCodes() { + return this.statusCodes; + } + + /** + * Set the statusCodes property: Allowed ranges of healthy status codes. Default range of healthy status codes is + * 200-399. + * + * @param statusCodes the statusCodes value to set. + * @return the ApplicationGatewayProbeHealthResponseMatch object itself. + */ + public ApplicationGatewayProbeHealthResponseMatch withStatusCodes(List statusCodes) { + this.statusCodes = statusCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java new file mode 100644 index 0000000000000..60515feeb705c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayProtocol. */ +public final class ApplicationGatewayProtocol extends ExpandableStringEnum { + /** Static value Http for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTP = fromString("Http"); + + /** Static value Https for ApplicationGatewayProtocol. */ + public static final ApplicationGatewayProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayProtocol. + */ + @JsonCreator + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** @return known ApplicationGatewayProtocol values. */ + public static Collection values() { + return values(ApplicationGatewayProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java new file mode 100644 index 0000000000000..8389990b1ebf8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRedirectConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Redirect configuration of an application gateway. */ +@Fluent +public final class ApplicationGatewayRedirectConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRedirectConfiguration.class); + + /* + * 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; + + /** + * 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..e5e4d5c839121 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayRedirectType. */ +public final class ApplicationGatewayRedirectType extends ExpandableStringEnum { + /** Static value Permanent for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType PERMANENT = fromString("Permanent"); + + /** Static value Found for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType FOUND = fromString("Found"); + + /** Static value SeeOther for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType SEE_OTHER = fromString("SeeOther"); + + /** Static value Temporary for ApplicationGatewayRedirectType. */ + public static final ApplicationGatewayRedirectType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRedirectType. + */ + @JsonCreator + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** @return known ApplicationGatewayRedirectType values. */ + public static Collection values() { + return values(ApplicationGatewayRedirectType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java new file mode 100644 index 0000000000000..192bf2ea2a037 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRequestRoutingRulePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request routing rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRequestRoutingRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRequestRoutingRule.class); + + /* + * 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; + + /** + * 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..48b3636d28c8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayRequestRoutingRuleType. */ +public final class ApplicationGatewayRequestRoutingRuleType + extends ExpandableStringEnum { + /** Static value Basic for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType BASIC = fromString("Basic"); + + /** Static value PathBasedRouting for ApplicationGatewayRequestRoutingRuleType. */ + public static final ApplicationGatewayRequestRoutingRuleType PATH_BASED_ROUTING = fromString("PathBasedRouting"); + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRequestRoutingRuleType. + */ + @JsonCreator + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** @return known ApplicationGatewayRequestRoutingRuleType values. */ + public static Collection values() { + return values(ApplicationGatewayRequestRoutingRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java new file mode 100644 index 0000000000000..e727734b2d6e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rewrite rule of an application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRule.class); + + /* + * Name of the rewrite rule that is unique within an Application Gateway. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Rule Sequence of the rewrite rule that determines the order of execution + * of a particular rule in a RewriteRuleSet. + */ + @JsonProperty(value = "ruleSequence") + private Integer ruleSequence; + + /* + * Conditions based on which the action set execution will be evaluated. + */ + @JsonProperty(value = "conditions") + private List conditions; + + /* + * Set of actions to be done as part of the rewrite Rule. + */ + @JsonProperty(value = "actionSet") + private ApplicationGatewayRewriteRuleActionSet actionSet; + + /** + * Get the name property: Name of the rewrite rule that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rewrite rule that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ruleSequence property: Rule Sequence of the rewrite rule that determines the order of execution of a + * particular rule in a RewriteRuleSet. + * + * @return the ruleSequence value. + */ + public Integer ruleSequence() { + return this.ruleSequence; + } + + /** + * Set the ruleSequence property: Rule Sequence of the rewrite rule that determines the order of execution of a + * particular rule in a RewriteRuleSet. + * + * @param ruleSequence the ruleSequence value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withRuleSequence(Integer ruleSequence) { + this.ruleSequence = ruleSequence; + return this; + } + + /** + * Get the conditions property: Conditions based on which the action set execution will be evaluated. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Conditions based on which the action set execution will be evaluated. + * + * @param conditions the conditions value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the actionSet property: Set of actions to be done as part of the rewrite Rule. + * + * @return the actionSet value. + */ + public ApplicationGatewayRewriteRuleActionSet actionSet() { + return this.actionSet; + } + + /** + * Set the actionSet property: Set of actions to be done as part of the rewrite Rule. + * + * @param actionSet the actionSet value to set. + * @return the ApplicationGatewayRewriteRule object itself. + */ + public ApplicationGatewayRewriteRule withActionSet(ApplicationGatewayRewriteRuleActionSet actionSet) { + this.actionSet = actionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + if (actionSet() != null) { + actionSet().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java new file mode 100644 index 0000000000000..058c9b284780f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Set of actions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleActionSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleActionSet.class); + + /* + * Request Header Actions in the Action Set. + */ + @JsonProperty(value = "requestHeaderConfigurations") + private List requestHeaderConfigurations; + + /* + * Response Header Actions in the Action Set. + */ + @JsonProperty(value = "responseHeaderConfigurations") + private List responseHeaderConfigurations; + + /* + * Url Configuration Action in the Action Set. + */ + @JsonProperty(value = "urlConfiguration") + private ApplicationGatewayUrlConfiguration urlConfiguration; + + /** + * Get the requestHeaderConfigurations property: Request Header Actions in the Action Set. + * + * @return the requestHeaderConfigurations value. + */ + public List requestHeaderConfigurations() { + return this.requestHeaderConfigurations; + } + + /** + * Set the requestHeaderConfigurations property: Request Header Actions in the Action Set. + * + * @param requestHeaderConfigurations the requestHeaderConfigurations value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withRequestHeaderConfigurations( + List requestHeaderConfigurations) { + this.requestHeaderConfigurations = requestHeaderConfigurations; + return this; + } + + /** + * Get the responseHeaderConfigurations property: Response Header Actions in the Action Set. + * + * @return the responseHeaderConfigurations value. + */ + public List responseHeaderConfigurations() { + return this.responseHeaderConfigurations; + } + + /** + * Set the responseHeaderConfigurations property: Response Header Actions in the Action Set. + * + * @param responseHeaderConfigurations the responseHeaderConfigurations value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withResponseHeaderConfigurations( + List responseHeaderConfigurations) { + this.responseHeaderConfigurations = responseHeaderConfigurations; + return this; + } + + /** + * Get the urlConfiguration property: Url Configuration Action in the Action Set. + * + * @return the urlConfiguration value. + */ + public ApplicationGatewayUrlConfiguration urlConfiguration() { + return this.urlConfiguration; + } + + /** + * Set the urlConfiguration property: Url Configuration Action in the Action Set. + * + * @param urlConfiguration the urlConfiguration value to set. + * @return the ApplicationGatewayRewriteRuleActionSet object itself. + */ + public ApplicationGatewayRewriteRuleActionSet withUrlConfiguration( + ApplicationGatewayUrlConfiguration urlConfiguration) { + this.urlConfiguration = urlConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requestHeaderConfigurations() != null) { + requestHeaderConfigurations().forEach(e -> e.validate()); + } + if (responseHeaderConfigurations() != null) { + responseHeaderConfigurations().forEach(e -> e.validate()); + } + if (urlConfiguration() != null) { + urlConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java new file mode 100644 index 0000000000000..12031647d6ff7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Set of conditions in the Rewrite Rule in Application Gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleCondition.class); + + /* + * The condition parameter of the RewriteRuleCondition. + */ + @JsonProperty(value = "variable") + private String variable; + + /* + * The pattern, either fixed string or regular expression, that evaluates + * the truthfulness of the condition. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Setting this parameter to truth value with force the pattern to do a + * case in-sensitive comparison. + */ + @JsonProperty(value = "ignoreCase") + private Boolean ignoreCase; + + /* + * Setting this value as truth will force to check the negation of the + * condition given by the user. + */ + @JsonProperty(value = "negate") + private Boolean negate; + + /** + * Get the variable property: The condition parameter of the RewriteRuleCondition. + * + * @return the variable value. + */ + public String variable() { + return this.variable; + } + + /** + * Set the variable property: The condition parameter of the RewriteRuleCondition. + * + * @param variable the variable value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withVariable(String variable) { + this.variable = variable; + return this; + } + + /** + * Get the pattern property: The pattern, either fixed string or regular expression, that evaluates the truthfulness + * of the condition. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: The pattern, either fixed string or regular expression, that evaluates the truthfulness + * of the condition. + * + * @param pattern the pattern value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the ignoreCase property: Setting this parameter to truth value with force the pattern to do a case + * in-sensitive comparison. + * + * @return the ignoreCase value. + */ + public Boolean ignoreCase() { + return this.ignoreCase; + } + + /** + * Set the ignoreCase property: Setting this parameter to truth value with force the pattern to do a case + * in-sensitive comparison. + * + * @param ignoreCase the ignoreCase value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withIgnoreCase(Boolean ignoreCase) { + this.ignoreCase = ignoreCase; + return this; + } + + /** + * Get the negate property: Setting this value as truth will force to check the negation of the condition given by + * the user. + * + * @return the negate value. + */ + public Boolean negate() { + return this.negate; + } + + /** + * Set the negate property: Setting this value as truth will force to check the negation of the condition given by + * the user. + * + * @param negate the negate value to set. + * @return the ApplicationGatewayRewriteRuleCondition object itself. + */ + public ApplicationGatewayRewriteRuleCondition withNegate(Boolean negate) { + this.negate = negate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.java new file mode 100644 index 0000000000000..83efa19ebf176 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRewriteRuleSetPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Rewrite rule set of an application gateway. */ +@Fluent +public final class ApplicationGatewayRewriteRuleSet extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayRewriteRuleSet.class); + + /* + * 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; + + /** + * 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/ApplicationGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java new file mode 100644 index 0000000000000..80592b869a44f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of an application gateway. */ +@Fluent +public final class ApplicationGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySku.class); + + /* + * Name of an application gateway SKU. + */ + @JsonProperty(value = "name") + private ApplicationGatewaySkuName name; + + /* + * Tier of an application gateway. + */ + @JsonProperty(value = "tier") + private ApplicationGatewayTier tier; + + /* + * Capacity (instance count) of an application gateway. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of an application gateway SKU. + * + * @return the name value. + */ + public ApplicationGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Name of an application gateway SKU. + * + * @param name the name value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withName(ApplicationGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of an application gateway. + * + * @return the tier value. + */ + public ApplicationGatewayTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of an application gateway. + * + * @param tier the tier value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withTier(ApplicationGatewayTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Capacity (instance count) of an application gateway. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity (instance count) of an application gateway. + * + * @param capacity the capacity value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java new file mode 100644 index 0000000000000..a3a650cee3afd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySkuName. */ +public final class ApplicationGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard_Small for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_SMALL = fromString("Standard_Small"); + + /** Static value Standard_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_MEDIUM = fromString("Standard_Medium"); + + /** Static value Standard_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_LARGE = fromString("Standard_Large"); + + /** Static value WAF_Medium for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_MEDIUM = fromString("WAF_Medium"); + + /** Static value WAF_Large for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_LARGE = fromString("WAF_Large"); + + /** Static value Standard_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewaySkuName. */ + public static final ApplicationGatewaySkuName WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySkuName. + */ + @JsonCreator + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** @return known ApplicationGatewaySkuName values. */ + public static Collection values() { + return values(ApplicationGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java new file mode 100644 index 0000000000000..34b68b9f9cf5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSL certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslCertificate.class); + + /* + * 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; + + /** + * 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..9c78775882880 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslCipherSuite. */ +public final class ApplicationGatewaySslCipherSuite extends ExpandableStringEnum { + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = + fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_DHE_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_DHE_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_DHE_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_RSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = + fromString("TLS_RSA_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_RSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_RSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_256_CBC_SHA = + fromString("TLS_RSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_RSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_AES_128_CBC_SHA = + fromString("TLS_RSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = + fromString("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = + fromString("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = + fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = + fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"); + + /** Static value TLS_DHE_DSS_WITH_AES_256_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_256_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_AES_256_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_AES_128_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_AES_128_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + + /** Static value TLS_RSA_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_RSA_WITH_3DES_EDE_CBC_SHA = + fromString("TLS_RSA_WITH_3DES_EDE_CBC_SHA"); + + /** Static value TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = + fromString("TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = + fromString("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"); + + /** Static value TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 for ApplicationGatewaySslCipherSuite. */ + public static final ApplicationGatewaySslCipherSuite TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = + fromString("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"); + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslCipherSuite. + */ + @JsonCreator + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** @return known ApplicationGatewaySslCipherSuite values. */ + public static Collection values() { + return values(ApplicationGatewaySslCipherSuite.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java new file mode 100644 index 0000000000000..44c1ae1ae969d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Gateway Ssl policy. */ +@Fluent +public final class ApplicationGatewaySslPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslPolicy.class); + + /* + * Ssl protocols to be disabled on application gateway. + */ + @JsonProperty(value = "disabledSslProtocols") + private List disabledSslProtocols; + + /* + * Type of Ssl Policy. + */ + @JsonProperty(value = "policyType") + private ApplicationGatewaySslPolicyType policyType; + + /* + * Name of Ssl predefined policy. + */ + @JsonProperty(value = "policyName") + private ApplicationGatewaySslPolicyName policyName; + + /* + * Ssl cipher suites to be enabled in the specified order to application + * gateway. + */ + @JsonProperty(value = "cipherSuites") + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + @JsonProperty(value = "minProtocolVersion") + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Get the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. + * + * @return the disabledSslProtocols value. + */ + public List disabledSslProtocols() { + return this.disabledSslProtocols; + } + + /** + * Set the disabledSslProtocols property: Ssl protocols to be disabled on application gateway. + * + * @param disabledSslProtocols the disabledSslProtocols value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withDisabledSslProtocols( + List disabledSslProtocols) { + this.disabledSslProtocols = disabledSslProtocols; + return this; + } + + /** + * Get the policyType property: Type of Ssl Policy. + * + * @return the policyType value. + */ + public ApplicationGatewaySslPolicyType policyType() { + return this.policyType; + } + + /** + * Set the policyType property: Type of Ssl Policy. + * + * @param policyType the policyType value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyType(ApplicationGatewaySslPolicyType policyType) { + this.policyType = policyType; + return this; + } + + /** + * Get the policyName property: Name of Ssl predefined policy. + * + * @return the policyName value. + */ + public ApplicationGatewaySslPolicyName policyName() { + return this.policyName; + } + + /** + * Set the policyName property: Name of Ssl predefined policy. + * + * @param policyName the policyName value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withPolicyName(ApplicationGatewaySslPolicyName policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. + * + * @return the cipherSuites value. + */ + public List cipherSuites() { + return this.cipherSuites; + } + + /** + * Set the cipherSuites property: Ssl cipher suites to be enabled in the specified order to application gateway. + * + * @param cipherSuites the cipherSuites value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withCipherSuites(List cipherSuites) { + this.cipherSuites = cipherSuites; + return this; + } + + /** + * Get the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + public ApplicationGatewaySslProtocol minProtocolVersion() { + return this.minProtocolVersion; + } + + /** + * Set the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @param minProtocolVersion the minProtocolVersion value to set. + * @return the ApplicationGatewaySslPolicy object itself. + */ + public ApplicationGatewaySslPolicy withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java new file mode 100644 index 0000000000000..97c1e820a943a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslPolicyName. */ +public final class ApplicationGatewaySslPolicyName extends ExpandableStringEnum { + /** Static value AppGwSslPolicy20150501 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20150501 = + fromString("AppGwSslPolicy20150501"); + + /** Static value AppGwSslPolicy20170401 for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401 = + fromString("AppGwSslPolicy20170401"); + + /** Static value AppGwSslPolicy20170401S for ApplicationGatewaySslPolicyName. */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20170401S = + fromString("AppGwSslPolicy20170401S"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyName. + */ + @JsonCreator + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** @return known ApplicationGatewaySslPolicyName values. */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java new file mode 100644 index 0000000000000..d09a08e7702ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslPolicyType. */ +public final class ApplicationGatewaySslPolicyType extends ExpandableStringEnum { + /** Static value Predefined for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType PREDEFINED = fromString("Predefined"); + + /** Static value Custom for ApplicationGatewaySslPolicyType. */ + public static final ApplicationGatewaySslPolicyType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyType. + */ + @JsonCreator + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** @return known ApplicationGatewaySslPolicyType values. */ + public static Collection values() { + return values(ApplicationGatewaySslPolicyType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java new file mode 100644 index 0000000000000..f4d30389d497a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import java.util.List; + +/** An immutable client-side representation of ApplicationGatewaySslPredefinedPolicy. */ +public interface ApplicationGatewaySslPredefinedPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the Ssl predefined policy. + * + * @return the name value. + */ + String name(); + + /** + * Gets the cipherSuites property: Ssl cipher suites to be enabled in the specified order for application gateway. + * + * @return the cipherSuites value. + */ + List cipherSuites(); + + /** + * Gets the minProtocolVersion property: Minimum version of Ssl protocol to be supported on application gateway. + * + * @return the minProtocolVersion value. + */ + ApplicationGatewaySslProtocol minProtocolVersion(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner object. + * + * @return the inner object. + */ + ApplicationGatewaySslPredefinedPolicyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.java new file mode 100644 index 0000000000000..f83c354e0cac3 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslProfilePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSL profile of an application gateway. */ +@Fluent +public final class ApplicationGatewaySslProfile extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewaySslProfile.class); + + /* + * 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; + + /** + * 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..c6786fc441202 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewaySslProtocol. */ +public final class ApplicationGatewaySslProtocol extends ExpandableStringEnum { + /** Static value TLSv1_0 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_0 = fromString("TLSv1_0"); + + /** Static value TLSv1_1 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_1 = fromString("TLSv1_1"); + + /** Static value TLSv1_2 for ApplicationGatewaySslProtocol. */ + public static final ApplicationGatewaySslProtocol TLSV1_2 = fromString("TLSv1_2"); + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslProtocol. + */ + @JsonCreator + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** @return known ApplicationGatewaySslProtocol values. */ + public static Collection values() { + return values(ApplicationGatewaySslProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java new file mode 100644 index 0000000000000..1f49bcaef48e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationGatewayTier. */ +public final class ApplicationGatewayTier extends ExpandableStringEnum { + /** Static value Standard for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD = fromString("Standard"); + + /** Static value WAF for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF = fromString("WAF"); + + /** Static value Standard_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier STANDARD_V2 = fromString("Standard_v2"); + + /** Static value WAF_v2 for ApplicationGatewayTier. */ + public static final ApplicationGatewayTier WAF_V2 = fromString("WAF_v2"); + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayTier. + */ + @JsonCreator + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** @return known ApplicationGatewayTier values. */ + public static Collection values() { + return values(ApplicationGatewayTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java new file mode 100644 index 0000000000000..fe8db902bffa8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedClientCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted client certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayTrustedClientCertificate.class); + + /* + * 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; + + /** + * 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..fdd6855a02158 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedRootCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates of an application gateway. */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayTrustedRootCertificate.class); + + /* + * 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; + + /** + * 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..8f233ed7bc070 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Url configuration of the Actions set in Application Gateway. */ +@Fluent +public final class ApplicationGatewayUrlConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlConfiguration.class); + + /* + * Url path which user has provided for url rewrite. Null means no path + * will be updated. Default value is null. + */ + @JsonProperty(value = "modifiedPath") + private String modifiedPath; + + /* + * Query string which user has provided for url rewrite. Null means no + * query string will be updated. Default value is null. + */ + @JsonProperty(value = "modifiedQueryString") + private String modifiedQueryString; + + /* + * If set as true, it will re-evaluate the url path map provided in path + * based request routing rules using modified path. Default value is false. + */ + @JsonProperty(value = "reroute") + private Boolean reroute; + + /** + * Get the modifiedPath property: Url path which user has provided for url rewrite. Null means no path will be + * updated. Default value is null. + * + * @return the modifiedPath value. + */ + public String modifiedPath() { + return this.modifiedPath; + } + + /** + * Set the modifiedPath property: Url path which user has provided for url rewrite. Null means no path will be + * updated. Default value is null. + * + * @param modifiedPath the modifiedPath value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withModifiedPath(String modifiedPath) { + this.modifiedPath = modifiedPath; + return this; + } + + /** + * Get the modifiedQueryString property: Query string which user has provided for url rewrite. Null means no query + * string will be updated. Default value is null. + * + * @return the modifiedQueryString value. + */ + public String modifiedQueryString() { + return this.modifiedQueryString; + } + + /** + * Set the modifiedQueryString property: Query string which user has provided for url rewrite. Null means no query + * string will be updated. Default value is null. + * + * @param modifiedQueryString the modifiedQueryString value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withModifiedQueryString(String modifiedQueryString) { + this.modifiedQueryString = modifiedQueryString; + return this; + } + + /** + * Get the reroute property: If set as true, it will re-evaluate the url path map provided in path based request + * routing rules using modified path. Default value is false. + * + * @return the reroute value. + */ + public Boolean reroute() { + return this.reroute; + } + + /** + * Set the reroute property: If set as true, it will re-evaluate the url path map provided in path based request + * routing rules using modified path. Default value is false. + * + * @param reroute the reroute value to set. + * @return the ApplicationGatewayUrlConfiguration object itself. + */ + public ApplicationGatewayUrlConfiguration withReroute(Boolean reroute) { + this.reroute = reroute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.java new file mode 100644 index 0000000000000..11ee1221f6e26 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayUrlPathMapPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. */ +@Fluent +public final class ApplicationGatewayUrlPathMap extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGatewayUrlPathMap.class); + + /* + * 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; + + /** + * 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/ApplicationGatewayWebApplicationFirewallConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java new file mode 100644 index 0000000000000..ac4aafac33fb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application gateway web application firewall configuration. */ +@Fluent +public final class ApplicationGatewayWebApplicationFirewallConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApplicationGatewayWebApplicationFirewallConfiguration.class); + + /* + * Whether the web application firewall is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Web application firewall mode. + */ + @JsonProperty(value = "firewallMode", required = true) + private ApplicationGatewayFirewallMode firewallMode; + + /* + * The type of the web application firewall rule set. Possible values are: + * 'OWASP'. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * The version of the rule set type. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * The disabled rule groups. + */ + @JsonProperty(value = "disabledRuleGroups") + private List disabledRuleGroups; + + /* + * Whether allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size for WAF. + */ + @JsonProperty(value = "maxRequestBodySize") + private Integer maxRequestBodySize; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /* + * The exclusion list. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /** + * Get the enabled property: Whether the web application firewall is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the web application firewall is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the firewallMode property: Web application firewall mode. + * + * @return the firewallMode value. + */ + public ApplicationGatewayFirewallMode firewallMode() { + return this.firewallMode; + } + + /** + * Set the firewallMode property: Web application firewall mode. + * + * @param firewallMode the firewallMode value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFirewallMode( + ApplicationGatewayFirewallMode firewallMode) { + this.firewallMode = firewallMode; + return this; + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: The type of the web application firewall rule set. Possible values are: 'OWASP'. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: The version of the rule set type. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: The version of the rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the disabledRuleGroups property: The disabled rule groups. + * + * @return the disabledRuleGroups value. + */ + public List disabledRuleGroups() { + return this.disabledRuleGroups; + } + + /** + * Set the disabledRuleGroups property: The disabled rule groups. + * + * @param disabledRuleGroups the disabledRuleGroups value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withDisabledRuleGroups( + List disabledRuleGroups) { + this.disabledRuleGroups = disabledRuleGroups; + return this; + } + + /** + * Get the requestBodyCheck property: Whether allow WAF to check request Body. + * + * @return the requestBodyCheck value. + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set the requestBodyCheck property: Whether allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get the maxRequestBodySize property: Maximum request body size for WAF. + * + * @return the maxRequestBodySize value. + */ + public Integer maxRequestBodySize() { + return this.maxRequestBodySize; + } + + /** + * Set the maxRequestBodySize property: Maximum request body size for WAF. + * + * @param maxRequestBodySize the maxRequestBodySize value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySize(Integer maxRequestBodySize) { + this.maxRequestBodySize = maxRequestBodySize; + return this; + } + + /** + * Get the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value. + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withMaxRequestBodySizeInKb( + Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value. + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * Get the exclusions property: The exclusion list. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: The exclusion list. + * + * @param exclusions the exclusions value to set. + * @return the ApplicationGatewayWebApplicationFirewallConfiguration object itself. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration withExclusions( + List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallMode() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property firewallMode in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetType in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleSetVersion in model" + + " ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (disabledRuleGroups() != null) { + disabledRuleGroups().forEach(e -> e.validate()); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java new file mode 100644 index 0000000000000..5d83f378370dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ApplicationGateways. */ +public interface ApplicationGateways { + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String applicationGatewayName); + + /** + * Deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway. + */ + ApplicationGateway getByResourceGroup(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the application gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the application gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application gateways in a subscription. + */ + PagedIterable list(Context context); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String applicationGatewayName); + + /** + * Starts the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String applicationGatewayName); + + /** + * Stops the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String applicationGatewayName, Context context); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth(String resourceGroupName, String applicationGatewayName); + + /** + * Gets the backend health of the specified application gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health of the specified application gateway in a resource group. + */ + ApplicationGatewayBackendHealth backendHealth( + String resourceGroupName, String applicationGatewayName, String expand, Context context); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest); + + /** + * Gets the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @param probeRequest Request body for on-demand test probe operation. + * @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the backend health for given combination of backend pool and http setting of the specified application + * gateway in a resource group. + */ + ApplicationGatewayBackendHealthOnDemand backendHealthOnDemand( + String resourceGroupName, + String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, + String expand, + Context context); + + /** + * Lists all available server variables. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call. + */ + List listAvailableServerVariables(); + + /** + * Lists all available server variables. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response}. + */ + Response> listAvailableServerVariablesWithResponse(Context context); + + /** + * Lists all available request headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call. + */ + List listAvailableRequestHeaders(); + + /** + * Lists all available request headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response}. + */ + Response> listAvailableRequestHeadersWithResponse(Context context); + + /** + * Lists all available response headers. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call. + */ + List listAvailableResponseHeaders(); + + /** + * Lists all available response headers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response}. + */ + Response> listAvailableResponseHeadersWithResponse(Context context); + + /** + * Lists all available web application firewall rule sets. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call. + */ + ApplicationGatewayAvailableWafRuleSetsResult listAvailableWafRuleSets(); + + /** + * Lists all available web application firewall rule sets. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response}. + */ + Response listAvailableWafRuleSetsWithResponse(Context context); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + ApplicationGatewayAvailableSslOptions listAvailableSslOptions(); + + /** + * Lists available Ssl options for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response}. + */ + Response listAvailableSslOptionsWithResponse(Context context); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + PagedIterable listAvailableSslPredefinedPolicies(); + + /** + * Lists all SSL predefined policies for configuring Ssl policy. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call. + */ + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name. + */ + ApplicationGatewaySslPredefinedPolicy getSslPredefinedPolicy(String predefinedPolicyName); + + /** + * Gets Ssl predefined policy with the specified policy name. + * + * @param predefinedPolicyName Name of Ssl predefined policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ssl predefined policy with the specified policy name along with {@link Response}. + */ + Response getSslPredefinedPolicyWithResponse( + String predefinedPolicyName, Context context); + + /** + * Gets the specified application gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified application gateway 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..2c564f2a8659d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type application. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("ApplicationRule") +@Fluent +public final class ApplicationRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationRule.class); + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * Array of Application Protocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of Urls for this rule condition. + */ + @JsonProperty(value = "targetUrls") + private List targetUrls; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * Terminate TLS connections for this rule. + */ + @JsonProperty(value = "terminateTLS") + private Boolean terminateTls; + + /* + * List of destination azure web categories. + */ + @JsonProperty(value = "webCategories") + private List webCategories; + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the protocols property: Array of Application Protocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of Application Protocols. + * + * @param protocols the protocols value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the targetFqdns property: List of FQDNs for this rule. + * + * @return the targetFqdns value. + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set the targetFqdns property: List of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get the targetUrls property: List of Urls for this rule condition. + * + * @return the targetUrls value. + */ + public List targetUrls() { + return this.targetUrls; + } + + /** + * Set the targetUrls property: List of Urls for this rule condition. + * + * @param targetUrls the targetUrls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTargetUrls(List targetUrls) { + this.targetUrls = targetUrls; + return this; + } + + /** + * Get the fqdnTags property: List of FQDN Tags for this rule. + * + * @return the fqdnTags value. + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set the fqdnTags property: List of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the terminateTls property: Terminate TLS connections for this rule. + * + * @return the terminateTls value. + */ + public Boolean terminateTls() { + return this.terminateTls; + } + + /** + * Set the terminateTls property: Terminate TLS connections for this rule. + * + * @param terminateTls the terminateTls value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withTerminateTls(Boolean terminateTls) { + this.terminateTls = terminateTls; + return this; + } + + /** + * Get the webCategories property: List of destination azure web categories. + * + * @return the webCategories value. + */ + public List webCategories() { + return this.webCategories; + } + + /** + * Set the webCategories property: List of destination azure web categories. + * + * @param webCategories the webCategories value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withWebCategories(List webCategories) { + this.webCategories = webCategories; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplicationRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java new file mode 100644 index 0000000000000..0eeb86d9f136c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import java.util.Map; + +/** An immutable client-side representation of ApplicationSecurityGroup. */ +public interface ApplicationSecurityGroup { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner object. + * + * @return the inner object. + */ + ApplicationSecurityGroupInner innerModel(); + + /** The entirety of the ApplicationSecurityGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ApplicationSecurityGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationSecurityGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApplicationSecurityGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ApplicationSecurityGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ApplicationSecurityGroup definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationSecurityGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationSecurityGroup create(Context context); + } + /** The stage of the ApplicationSecurityGroup definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the ApplicationSecurityGroup resource. + * + * @return the stage of resource update. + */ + ApplicationSecurityGroup.Update update(); + + /** The template for ApplicationSecurityGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationSecurityGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationSecurityGroup apply(Context context); + } + /** The ApplicationSecurityGroup update stages. */ + interface UpdateStages { + /** The stage of the ApplicationSecurityGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationSecurityGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationSecurityGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java new file mode 100644 index 0000000000000..278e8d2b85606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of application security groups. */ +@Fluent +public final class ApplicationSecurityGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationSecurityGroupListResult.class); + + /* + * A list of application security groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of application security groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of application security groups. + * + * @param value the value value to set. + * @return the ApplicationSecurityGroupListResult object itself. + */ + public ApplicationSecurityGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java new file mode 100644 index 0000000000000..2801d2cdda59c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationSecurityGroups. */ +public interface ApplicationSecurityGroups { + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Deletes the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group. + */ + ApplicationSecurityGroup getByResourceGroup(String resourceGroupName, String applicationSecurityGroupName); + + /** + * Gets information about the specified application security group. + * + * @param resourceGroupName The name of the resource group. + * @param applicationSecurityGroupName The name of the application security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String applicationSecurityGroupName, Context context); + + /** + * Gets all application security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all application security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all application security groups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the application security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the application security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified application security group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified application security group 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..09cdc5dc831df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AssociationType. */ +public final class AssociationType extends ExpandableStringEnum { + /** Static value Associated for AssociationType. */ + public static final AssociationType ASSOCIATED = fromString("Associated"); + + /** Static value Contains for AssociationType. */ + public static final AssociationType CONTAINS = fromString("Contains"); + + /** + * Creates or finds a AssociationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssociationType. + */ + @JsonCreator + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** @return known AssociationType values. */ + public static Collection values() { + return values(AssociationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java new file mode 100644 index 0000000000000..f44e4242238d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationMethod. */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value EAPTLS for AuthenticationMethod. */ + public static final AuthenticationMethod EAPTLS = fromString("EAPTLS"); + + /** Static value EAPMSCHAPv2 for AuthenticationMethod. */ + public static final AuthenticationMethod EAPMSCHAPV2 = fromString("EAPMSCHAPv2"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** @return known AuthenticationMethod values. */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java new file mode 100644 index 0000000000000..dc557a34329cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + */ +@Fluent +public final class AuthorizationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationListResult.class); + + /* + * The authorizations in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The authorizations in an ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The authorizations in an ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the AuthorizationListResult object itself. + */ + public AuthorizationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AuthorizationListResult object itself. + */ + public AuthorizationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java new file mode 100644 index 0000000000000..af221b520cef1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthorizationUseStatus. */ +public final class AuthorizationUseStatus extends ExpandableStringEnum { + /** Static value Available for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** Static value InUse for AuthorizationUseStatus. */ + public static final AuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthorizationUseStatus. + */ + @JsonCreator + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** @return known AuthorizationUseStatus values. */ + public static Collection values() { + return values(AuthorizationUseStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java new file mode 100644 index 0000000000000..45e1bb84ff428 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; + +/** An immutable client-side representation of AutoApprovedPrivateLinkService. */ +public interface AutoApprovedPrivateLinkService { + /** + * Gets the privateLinkService property: The id of the private link service resource. + * + * @return the privateLinkService value. + */ + String privateLinkService(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner + * object. + * + * @return the inner object. + */ + AutoApprovedPrivateLinkServiceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java new file mode 100644 index 0000000000000..2375df0ad726a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of private link service id that can be linked to a private end point with auto approved. */ +@Fluent +public final class AutoApprovedPrivateLinkServicesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoApprovedPrivateLinkServicesResult.class); + + /* + * An array of auto approved private link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of auto approved private link service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of auto approved private link service. + * + * @param value the value value to set. + * @return the AutoApprovedPrivateLinkServicesResult object itself. + */ + public AutoApprovedPrivateLinkServicesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java new file mode 100644 index 0000000000000..25ea0cbd756ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Availability of the metric. */ +@Fluent +public final class Availability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Availability.class); + + /* + * The time grain of the availability. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The retention of the availability. + */ + @JsonProperty(value = "retention") + private String retention; + + /* + * Duration of the availability blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the timeGrain property: The time grain of the availability. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The time grain of the availability. + * + * @param timeGrain the timeGrain value to set. + * @return the Availability object itself. + */ + public Availability withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the retention property: The retention of the availability. + * + * @return the retention value. + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention property: The retention of the availability. + * + * @param retention the retention value to set. + * @return the Availability object itself. + */ + public Availability withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get the blobDuration property: Duration of the availability blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Duration of the availability blob. + * + * @param blobDuration the blobDuration value to set. + * @return the Availability object itself. + */ + public Availability withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java new file mode 100644 index 0000000000000..5780fce3545dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import java.util.List; + +/** An immutable client-side representation of AvailableDelegation. */ +public interface AvailableDelegation { + /** + * Gets the name property: The name of the AvailableDelegation resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailableDelegation resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the serviceName property: The name of the service and resource. + * + * @return the serviceName value. + */ + String serviceName(); + + /** + * Gets the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner object. + * + * @return the inner object. + */ + AvailableDelegationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java new file mode 100644 index 0000000000000..0bc993ad41945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableDelegations. */ +public interface AvailableDelegations { + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + PagedIterable list(String location); + + /** + * Gets all of the available subnet delegations for this subscription in this region. + * + * @param location The location of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this subscription in this region. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java new file mode 100644 index 0000000000000..1a788c4132483 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available delegations. */ +@Fluent +public final class AvailableDelegationsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableDelegationsResult.class); + + /* + * An array of available delegations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available delegations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available delegations. + * + * @param value the value value to set. + * @return the AvailableDelegationsResult object itself. + */ + public AvailableDelegationsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java new file mode 100644 index 0000000000000..571d10842bfe2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableEndpointServices. */ +public interface AvailableEndpointServices { + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + PagedIterable list(String location); + + /** + * List what values of endpoint services are available for use. + * + * @param location The location to check available endpoint services. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java new file mode 100644 index 0000000000000..e3bc1fd8de6e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; + +/** An immutable client-side representation of AvailablePrivateEndpointType. */ +public interface AvailablePrivateEndpointType { + /** + * Gets the name property: The name of the service and resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: A unique identifier of the AvailablePrivateEndpoint Type resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The name of the service and resource. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner + * object. + * + * @return the inner object. + */ + AvailablePrivateEndpointTypeInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java new file mode 100644 index 0000000000000..440d4bb6764bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailablePrivateEndpointTypes. */ +public interface AvailablePrivateEndpointTypes { + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + PagedIterable list(String location); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + PagedIterable list(String location, Context context); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + PagedIterable listByResourceGroup(String location, String resourceGroupName); + + /** + * Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types. + */ + PagedIterable listByResourceGroup( + String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java new file mode 100644 index 0000000000000..a318749031ea3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available PrivateEndpoint types. */ +@Fluent +public final class AvailablePrivateEndpointTypesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailablePrivateEndpointTypesResult.class); + + /* + * An array of available privateEndpoint type. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available privateEndpoint type. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available privateEndpoint type. + * + * @param value the value value to set. + * @return the AvailablePrivateEndpointTypesResult object itself. + */ + public AvailablePrivateEndpointTypesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java new file mode 100644 index 0000000000000..1ec2bd562383b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner; +import java.util.List; + +/** An immutable client-side representation of AvailableProvidersList. */ +public interface AvailableProvidersList { + /** + * Gets the countries property: List of available countries. + * + * @return the countries value. + */ + List countries(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableProvidersListInner object. + * + * @return the inner object. + */ + AvailableProvidersListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java new file mode 100644 index 0000000000000..92de636aa6a00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** City or town details. */ +@Fluent +public final class AvailableProvidersListCity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCity.class); + + /* + * The city or town name. + */ + @JsonProperty(value = "cityName") + private String cityName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /** + * Get the cityName property: The city or town name. + * + * @return the cityName value. + */ + public String cityName() { + return this.cityName; + } + + /** + * Set the cityName property: The city or town name. + * + * @param cityName the cityName value to set. + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withCityName(String cityName) { + this.cityName = cityName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListCity object itself. + */ + public AvailableProvidersListCity withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java new file mode 100644 index 0000000000000..05e1ce6b585ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Country details. */ +@Fluent +public final class AvailableProvidersListCountry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListCountry.class); + + /* + * The country name. + */ + @JsonProperty(value = "countryName") + private String countryName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available states in the country. + */ + @JsonProperty(value = "states") + private List states; + + /** + * Get the countryName property: The country name. + * + * @return the countryName value. + */ + public String countryName() { + return this.countryName; + } + + /** + * Set the countryName property: The country name. + * + * @param countryName the countryName value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withCountryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the states property: List of available states in the country. + * + * @return the states value. + */ + public List states() { + return this.states; + } + + /** + * Set the states property: List of available states in the country. + * + * @param states the states value to set. + * @return the AvailableProvidersListCountry object itself. + */ + public AvailableProvidersListCountry withStates(List states) { + this.states = states; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (states() != null) { + states().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java new file mode 100644 index 0000000000000..1bc5f023ad3e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Constraints that determine the list of available Internet service providers. */ +@Fluent +public final class AvailableProvidersListParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListParameters.class); + + /* + * A list of Azure regions. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The country for available providers list. + */ + @JsonProperty(value = "country") + private String country; + + /* + * The state for available providers list. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The city or town for available providers list. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the azureLocations property: A list of Azure regions. + * + * @return the azureLocations value. + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set the azureLocations property: A list of Azure regions. + * + * @param azureLocations the azureLocations value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the country property: The country for available providers list. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country for available providers list. + * + * @param country the country value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state property: The state for available providers list. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state for available providers list. + * + * @param state the state value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city property: The city or town for available providers list. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city or town for available providers list. + * + * @param city the city value to set. + * @return the AvailableProvidersListParameters object itself. + */ + public AvailableProvidersListParameters withCity(String city) { + this.city = city; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java new file mode 100644 index 0000000000000..21ba30a471275 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** State details. */ +@Fluent +public final class AvailableProvidersListState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableProvidersListState.class); + + /* + * The state name. + */ + @JsonProperty(value = "stateName") + private String stateName; + + /* + * A list of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * List of available cities or towns in the state. + */ + @JsonProperty(value = "cities") + private List cities; + + /** + * Get the stateName property: The state name. + * + * @return the stateName value. + */ + public String stateName() { + return this.stateName; + } + + /** + * Set the stateName property: The state name. + * + * @param stateName the stateName value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withStateName(String stateName) { + this.stateName = stateName; + return this; + } + + /** + * Get the providers property: A list of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: A list of Internet service providers. + * + * @param providers the providers value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the cities property: List of available cities or towns in the state. + * + * @return the cities value. + */ + public List cities() { + return this.cities; + } + + /** + * Set the cities property: List of available cities or towns in the state. + * + * @param cities the cities value to set. + * @return the AvailableProvidersListState object itself. + */ + public AvailableProvidersListState withCities(List cities) { + this.cities = cities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cities() != null) { + cities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java new file mode 100644 index 0000000000000..4e998726a5210 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableResourceGroupDelegations. */ +public interface AvailableResourceGroupDelegations { + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + PagedIterable list(String location, String resourceGroupName); + + /** + * Gets all of the available subnet delegations for this resource group in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all of the available subnet delegations for this resource group in this region. + */ + PagedIterable list(String location, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java new file mode 100644 index 0000000000000..53f0e41492495 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; + +/** An immutable client-side representation of AvailableServiceAlias. */ +public interface AvailableServiceAlias { + /** + * Gets the name property: The name of the service alias. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the service alias. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the resourceName property: The resource name of the service alias. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner object. + * + * @return the inner object. + */ + AvailableServiceAliasInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java new file mode 100644 index 0000000000000..4436e6e35cc54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableServiceAliases. */ +public interface AvailableServiceAliases { + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + PagedIterable list(String location); + + /** + * Gets all available service aliases for this subscription in this region. + * + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this subscription in this region. + */ + PagedIterable list(String location, Context context); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String location); + + /** + * Gets all available service aliases for this resource group in this region. + * + * @param resourceGroupName The name of the resource group. + * @param location The location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available service aliases for this resource group in this region. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java new file mode 100644 index 0000000000000..39b9025ff6c03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An array of available service aliases. */ +@Fluent +public final class AvailableServiceAliasesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceAliasesResult.class); + + /* + * An array of available service aliases. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of available service aliases. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of available service aliases. + * + * @param value the value value to set. + * @return the AvailableServiceAliasesResult object itself. + */ + public AvailableServiceAliasesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java new file mode 100644 index 0000000000000..7eef49f8c64d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of AzureFirewall. */ +public interface AzureFirewall { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner object. + * + * @return the inner object. + */ + AzureFirewallInner innerModel(); + + /** The entirety of the AzureFirewall definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The AzureFirewall definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureFirewall definition. */ + interface Blank extends WithLocation { + } + /** The stage of the AzureFirewall definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the AzureFirewall definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the AzureFirewall definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithZones, + DefinitionStages.WithApplicationRuleCollections, + DefinitionStages.WithNatRuleCollections, + DefinitionStages.WithNetworkRuleCollections, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithManagementIpConfiguration, + DefinitionStages.WithThreatIntelMode, + DefinitionStages.WithVirtualHub, + DefinitionStages.WithFirewallPolicy, + DefinitionStages.WithHubIpAddresses, + DefinitionStages.WithSku, + DefinitionStages.WithAdditionalProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AzureFirewall create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureFirewall create(Context context); + } + /** The stage of the AzureFirewall definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the AzureFirewall definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the AzureFirewall definition allowing to specify applicationRuleCollections. */ + interface WithApplicationRuleCollections { + /** + * Specifies the applicationRuleCollections property: Collection of application rule collections used by + * Azure Firewall.. + * + * @param applicationRuleCollections Collection of application rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withApplicationRuleCollections( + List applicationRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify natRuleCollections. */ + interface WithNatRuleCollections { + /** + * Specifies the natRuleCollections property: Collection of NAT rule collections used by Azure Firewall.. + * + * @param natRuleCollections Collection of NAT rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNatRuleCollections(List natRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify networkRuleCollections. */ + interface WithNetworkRuleCollections { + /** + * Specifies the networkRuleCollections property: Collection of network rule collections used by Azure + * Firewall.. + * + * @param networkRuleCollections Collection of network rule collections used by Azure Firewall. + * @return the next definition stage. + */ + WithCreate withNetworkRuleCollections(List networkRuleCollections); + } + /** The stage of the AzureFirewall definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configuration of the Azure Firewall resource.. + * + * @param ipConfigurations IP configuration of the Azure Firewall resource. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the AzureFirewall definition allowing to specify managementIpConfiguration. */ + interface WithManagementIpConfiguration { + /** + * Specifies the managementIpConfiguration property: IP configuration of the Azure Firewall used for + * management traffic.. + * + * @param managementIpConfiguration IP configuration of the Azure Firewall used for management traffic. + * @return the next definition stage. + */ + WithCreate withManagementIpConfiguration(AzureFirewallIpConfiguration managementIpConfiguration); + } + /** The stage of the AzureFirewall definition allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + WithCreate withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the AzureFirewall definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The virtualHub to which the firewall belongs.. + * + * @param virtualHub The virtualHub to which the firewall belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the AzureFirewall definition allowing to specify firewallPolicy. */ + interface WithFirewallPolicy { + /** + * Specifies the firewallPolicy property: The firewallPolicy associated with this azure firewall.. + * + * @param firewallPolicy The firewallPolicy associated with this azure firewall. + * @return the next definition stage. + */ + WithCreate withFirewallPolicy(SubResource firewallPolicy); + } + /** The stage of the AzureFirewall definition allowing to specify hubIpAddresses. */ + interface WithHubIpAddresses { + /** + * Specifies the hubIpAddresses property: IP addresses associated with AzureFirewall.. + * + * @param hubIpAddresses IP addresses associated with AzureFirewall. + * @return the next definition stage. + */ + WithCreate withHubIpAddresses(HubIpAddresses hubIpAddresses); + } + /** The stage of the AzureFirewall definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Azure Firewall Resource SKU.. + * + * @param sku The Azure Firewall Resource SKU. + * @return the next definition stage. + */ + WithCreate withSku(AzureFirewallSku sku); + } + /** The stage of the AzureFirewall definition allowing to specify additionalProperties. */ + interface WithAdditionalProperties { + /** + * Specifies the additionalProperties property: The additional properties used to further config this azure + * firewall.. + * + * @param additionalProperties The additional properties used to further config this azure firewall. + * @return the next definition stage. + */ + WithCreate withAdditionalProperties(Map additionalProperties); + } + } + /** + * Begins update for the AzureFirewall resource. + * + * @return the stage of resource update. + */ + AzureFirewall.Update update(); + + /** The template for AzureFirewall update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureFirewall apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureFirewall apply(Context context); + } + /** The AzureFirewall update stages. */ + interface UpdateStages { + /** The stage of the AzureFirewall update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureFirewall refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureFirewall refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java new file mode 100644 index 0000000000000..b32f9af96b9f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of an application rule. */ +@Fluent +public final class AzureFirewallApplicationRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRule.class); + + /* + * Name of the application rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * Array of ApplicationRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of FQDNs for this rule. + */ + @JsonProperty(value = "targetFqdns") + private List targetFqdns; + + /* + * List of FQDN Tags for this rule. + */ + @JsonProperty(value = "fqdnTags") + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** + * Get the name property: Name of the application rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the application rule. + * + * @param name the name value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the protocols property: Array of ApplicationRuleProtocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of ApplicationRuleProtocols. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the targetFqdns property: List of FQDNs for this rule. + * + * @return the targetFqdns value. + */ + public List targetFqdns() { + return this.targetFqdns; + } + + /** + * Set the targetFqdns property: List of FQDNs for this rule. + * + * @param targetFqdns the targetFqdns value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withTargetFqdns(List targetFqdns) { + this.targetFqdns = targetFqdns; + return this; + } + + /** + * Get the fqdnTags property: List of FQDN Tags for this rule. + * + * @return the fqdnTags value. + */ + public List fqdnTags() { + return this.fqdnTags; + } + + /** + * Set the fqdnTags property: List of FQDN Tags for this rule. + * + * @param fqdnTags the fqdnTags value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withFqdnTags(List fqdnTags) { + this.fqdnTags = fqdnTags; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallApplicationRule object itself. + */ + public AzureFirewallApplicationRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java new file mode 100644 index 0000000000000..676bb1d444725 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallApplicationRuleCollectionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application rule collection resource. */ +@Fluent +public final class AzureFirewallApplicationRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleCollection.class); + + /* + * 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; + + /** + * 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..3cb45f5df11db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the application rule protocol. */ +@Fluent +public final class AzureFirewallApplicationRuleProtocol { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallApplicationRuleProtocol.class); + + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private AzureFirewallApplicationRuleProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. This field + * is optional. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the protocolType property: Protocol type. + * + * @return the protocolType value. + */ + public AzureFirewallApplicationRuleProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Protocol type. + * + * @param protocolType the protocolType value to set. + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withProtocolType( + AzureFirewallApplicationRuleProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port number for the protocol, cannot be greater than 64000. This field is optional. + * + * @param port the port value to set. + * @return the AzureFirewallApplicationRuleProtocol object itself. + */ + public AzureFirewallApplicationRuleProtocol withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java new file mode 100644 index 0000000000000..250a81db1fc50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallApplicationRuleProtocolType. */ +public final class AzureFirewallApplicationRuleProtocolType + extends ExpandableStringEnum { + /** Static value Http for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTP = fromString("Http"); + + /** Static value Https for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType HTTPS = fromString("Https"); + + /** Static value Mssql for AzureFirewallApplicationRuleProtocolType. */ + public static final AzureFirewallApplicationRuleProtocolType MSSQL = fromString("Mssql"); + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallApplicationRuleProtocolType. + */ + @JsonCreator + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** @return known AzureFirewallApplicationRuleProtocolType values. */ + public static Collection values() { + return values(AzureFirewallApplicationRuleProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.java new file mode 100644 index 0000000000000..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..b076ebf923e03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewallFqdnTags API service call. */ +@Fluent +public final class AzureFirewallFqdnTagListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallFqdnTagListResult.class); + + /* + * List of Azure Firewall FQDN Tags in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Firewall FQDN Tags in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Firewall FQDN Tags in a resource group. + * + * @param value the value value to set. + * @return the AzureFirewallFqdnTagListResult object itself. + */ + public AzureFirewallFqdnTagListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureFirewallFqdnTagListResult object itself. + */ + public AzureFirewallFqdnTagListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java new file mode 100644 index 0000000000000..14a238fae3474 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AzureFirewallFqdnTags. */ +public interface AzureFirewallFqdnTags { + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Firewall FQDN Tags in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewall FQDN Tags in a subscription. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.java new file mode 100644 index 0000000000000..5aeded3dca9c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Azure Firewall. */ +@Fluent +public final class AzureFirewallIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallIpConfiguration.class); + + /* + * 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; + + /** + * 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..d43c17b2f5e40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IpGroups associated with azure firewall. */ +@Immutable +public final class AzureFirewallIpGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallIpGroups.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The iteration number. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java new file mode 100644 index 0000000000000..0eee2cb4e838a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureFirewalls API service call. */ +@Fluent +public final class AzureFirewallListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallListResult.class); + + /* + * List of Azure Firewalls in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Firewalls in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Firewalls in a resource group. + * + * @param value the value value to set. + * @return the AzureFirewallListResult object itself. + */ + public AzureFirewallListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureFirewallListResult object itself. + */ + public AzureFirewallListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java new file mode 100644 index 0000000000000..44fd34839e3e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AzureFirewall NAT Rule Collection Action. */ +@Fluent +public final class AzureFirewallNatRCAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRCAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private AzureFirewallNatRCActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public AzureFirewallNatRCActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the AzureFirewallNatRCAction object itself. + */ + public AzureFirewallNatRCAction withType(AzureFirewallNatRCActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java new file mode 100644 index 0000000000000..4fae3708f2966 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallNatRCActionType. */ +public final class AzureFirewallNatRCActionType extends ExpandableStringEnum { + /** Static value Snat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType SNAT = fromString("Snat"); + + /** Static value Dnat for AzureFirewallNatRCActionType. */ + public static final AzureFirewallNatRCActionType DNAT = fromString("Dnat"); + + /** + * Creates or finds a AzureFirewallNatRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNatRCActionType. + */ + @JsonCreator + public static AzureFirewallNatRCActionType fromString(String name) { + return fromString(name, AzureFirewallNatRCActionType.class); + } + + /** @return known AzureFirewallNatRCActionType values. */ + public static Collection values() { + return values(AzureFirewallNatRCActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java new file mode 100644 index 0000000000000..a0ca47650d327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a NAT rule. */ +@Fluent +public final class AzureFirewallNatRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRule.class); + + /* + * Name of the NAT rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /** + * Get the name property: Name of the NAT rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the NAT rule. + * + * @param name the name value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses for this rule. Supports IP ranges, + * prefixes, and service tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the translatedAddress property: The translated address for this NAT rule. + * + * @return the translatedAddress value. + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translatedAddress property: The translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translatedPort property: The translated port for this NAT rule. + * + * @return the translatedPort value. + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translatedPort property: The translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + + /** + * Get the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @return the translatedFqdn value. + */ + public String translatedFqdn() { + return this.translatedFqdn; + } + + /** + * Set the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @param translatedFqdn the translatedFqdn value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withTranslatedFqdn(String translatedFqdn) { + this.translatedFqdn = translatedFqdn; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallNatRule object itself. + */ + public AzureFirewallNatRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java new file mode 100644 index 0000000000000..62aae0e020f81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNatRuleCollectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NAT rule collection resource. */ +@Fluent +public final class AzureFirewallNatRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNatRuleCollection.class); + + /* + * 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; + + /** + * 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..934145b7a433f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the network rule. */ +@Fluent +public final class AzureFirewallNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRule.class); + + /* + * Name of the network rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Array of AzureFirewallNetworkRuleProtocols. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** + * Get the name property: Name of the network rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network rule. + * + * @param name the name value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocols property: Array of AzureFirewallNetworkRuleProtocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Array of AzureFirewallNetworkRuleProtocols. + * + * @param protocols the protocols value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the destinationFqdns property: List of destination FQDNs. + * + * @return the destinationFqdns value. + */ + public List destinationFqdns() { + return this.destinationFqdns; + } + + /** + * Set the destinationFqdns property: List of destination FQDNs. + * + * @param destinationFqdns the destinationFqdns value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationFqdns(List destinationFqdns) { + this.destinationFqdns = destinationFqdns; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the AzureFirewallNetworkRule object itself. + */ + public AzureFirewallNetworkRule withDestinationIpGroups(List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java new file mode 100644 index 0000000000000..deb1970618147 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNetworkRuleCollectionPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network rule collection resource. */ +@Fluent +public final class AzureFirewallNetworkRuleCollection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallNetworkRuleCollection.class); + + /* + * 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; + + /** + * 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..85872f256576e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallNetworkRuleProtocol. */ +public final class AzureFirewallNetworkRuleProtocol extends ExpandableStringEnum { + /** Static value TCP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol TCP = fromString("TCP"); + + /** Static value UDP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol UDP = fromString("UDP"); + + /** Static value Any for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ANY = fromString("Any"); + + /** Static value ICMP for AzureFirewallNetworkRuleProtocol. */ + public static final AzureFirewallNetworkRuleProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNetworkRuleProtocol. + */ + @JsonCreator + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** @return known AzureFirewallNetworkRuleProtocol values. */ + public static Collection values() { + return values(AzureFirewallNetworkRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java new file mode 100644 index 0000000000000..74b1d65318b01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Public IP Address associated with azure firewall. */ +@Fluent +public final class AzureFirewallPublicIpAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallPublicIpAddress.class); + + /* + * Public IP Address value. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the address property: Public IP Address value. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Public IP Address value. + * + * @param address the address value to set. + * @return the AzureFirewallPublicIpAddress object itself. + */ + public AzureFirewallPublicIpAddress withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java new file mode 100644 index 0000000000000..f15a2247a4b22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the AzureFirewallRCAction. */ +@Fluent +public final class AzureFirewallRCAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallRCAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private AzureFirewallRCActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public AzureFirewallRCActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the AzureFirewallRCAction object itself. + */ + public AzureFirewallRCAction withType(AzureFirewallRCActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java new file mode 100644 index 0000000000000..61fcedb3a8093 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallRCActionType. */ +public final class AzureFirewallRCActionType extends ExpandableStringEnum { + /** Static value Allow for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType ALLOW = fromString("Allow"); + + /** Static value Deny for AzureFirewallRCActionType. */ + public static final AzureFirewallRCActionType DENY = fromString("Deny"); + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallRCActionType. + */ + @JsonCreator + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** @return known AzureFirewallRCActionType values. */ + public static Collection values() { + return values(AzureFirewallRCActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java new file mode 100644 index 0000000000000..a0a702a2d52b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of an Azure Firewall. */ +@Fluent +public final class AzureFirewallSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFirewallSku.class); + + /* + * Name of an Azure Firewall SKU. + */ + @JsonProperty(value = "name") + private AzureFirewallSkuName name; + + /* + * Tier of an Azure Firewall. + */ + @JsonProperty(value = "tier") + private AzureFirewallSkuTier tier; + + /** + * Get the name property: Name of an Azure Firewall SKU. + * + * @return the name value. + */ + public AzureFirewallSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of an Azure Firewall SKU. + * + * @param name the name value to set. + * @return the AzureFirewallSku object itself. + */ + public AzureFirewallSku withName(AzureFirewallSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of an Azure Firewall. + * + * @return the tier value. + */ + public AzureFirewallSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of an Azure Firewall. + * + * @param tier the tier value to set. + * @return the AzureFirewallSku object itself. + */ + public AzureFirewallSku withTier(AzureFirewallSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java new file mode 100644 index 0000000000000..91e86e8afc4c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallSkuName. */ +public final class AzureFirewallSkuName extends ExpandableStringEnum { + /** Static value AZFW_VNet for AzureFirewallSkuName. */ + public static final AzureFirewallSkuName AZFW_VNET = fromString("AZFW_VNet"); + + /** Static value AZFW_Hub for AzureFirewallSkuName. */ + public static final AzureFirewallSkuName AZFW_HUB = fromString("AZFW_Hub"); + + /** + * Creates or finds a AzureFirewallSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuName. + */ + @JsonCreator + public static AzureFirewallSkuName fromString(String name) { + return fromString(name, AzureFirewallSkuName.class); + } + + /** @return known AzureFirewallSkuName values. */ + public static Collection values() { + return values(AzureFirewallSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java new file mode 100644 index 0000000000000..d742291259e44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallSkuTier. */ +public final class AzureFirewallSkuTier extends ExpandableStringEnum { + /** Static value Standard for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier PREMIUM = fromString("Premium"); + + /** Static value Basic for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier BASIC = fromString("Basic"); + + /** + * Creates or finds a AzureFirewallSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuTier. + */ + @JsonCreator + public static AzureFirewallSkuTier fromString(String name) { + return fromString(name, AzureFirewallSkuTier.class); + } + + /** @return known AzureFirewallSkuTier values. */ + public static Collection values() { + return values(AzureFirewallSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java new file mode 100644 index 0000000000000..45b9b813379b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFirewallThreatIntelMode. */ +public final class AzureFirewallThreatIntelMode extends ExpandableStringEnum { + /** Static value Alert for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode ALERT = fromString("Alert"); + + /** Static value Deny for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode DENY = fromString("Deny"); + + /** Static value Off for AzureFirewallThreatIntelMode. */ + public static final AzureFirewallThreatIntelMode OFF = fromString("Off"); + + /** + * Creates or finds a AzureFirewallThreatIntelMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallThreatIntelMode. + */ + @JsonCreator + public static AzureFirewallThreatIntelMode fromString(String name) { + return fromString(name, AzureFirewallThreatIntelMode.class); + } + + /** @return known AzureFirewallThreatIntelMode values. */ + public static Collection values() { + return values(AzureFirewallThreatIntelMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java new file mode 100644 index 0000000000000..fcbde0c0ff32a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AzureFirewalls. */ +public interface AzureFirewalls { + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String azureFirewallName); + + /** + * Deletes the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String azureFirewallName, Context context); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall. + */ + AzureFirewall getByResourceGroup(String resourceGroupName, String azureFirewallName); + + /** + * Gets the specified Azure Firewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureFirewallName, Context context); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Azure Firewalls in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Firewalls in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Firewalls in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Azure Firewall. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Firewall 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..2632ca3afd383 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure reachability report details for a given provider location. */ +@Fluent +public final class AzureReachabilityReportItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportItem.class); + + /* + * The Internet service provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The Azure region. + */ + @JsonProperty(value = "azureLocation") + private String azureLocation; + + /* + * List of latency details for each of the time series. + */ + @JsonProperty(value = "latencies") + private List latencies; + + /** + * Get the provider property: The Internet service provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The Internet service provider. + * + * @param provider the provider value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the azureLocation property: The Azure region. + * + * @return the azureLocation value. + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the azureLocation property: The Azure region. + * + * @param azureLocation the azureLocation value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get the latencies property: List of latency details for each of the time series. + * + * @return the latencies value. + */ + public List latencies() { + return this.latencies; + } + + /** + * Set the latencies property: List of latency details for each of the time series. + * + * @param latencies the latencies value to set. + * @return the AzureReachabilityReportItem object itself. + */ + public AzureReachabilityReportItem withLatencies(List latencies) { + this.latencies = latencies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (latencies() != null) { + latencies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java new file mode 100644 index 0000000000000..9a2632fe56147 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Details on latency for a time series. */ +@Fluent +public final class AzureReachabilityReportLatencyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLatencyInfo.class); + + /* + * The time stamp. + */ + @JsonProperty(value = "timeStamp") + private OffsetDateTime timestamp; + + /* + * The relative latency score between 1 and 100, higher values indicating a + * faster connection. + */ + @JsonProperty(value = "score") + private Integer score; + + /** + * Get the timestamp property: The time stamp. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The time stamp. + * + * @param timestamp the timestamp value to set. + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the score property: The relative latency score between 1 and 100, higher values indicating a faster + * connection. + * + * @return the score value. + */ + public Integer score() { + return this.score; + } + + /** + * Set the score property: The relative latency score between 1 and 100, higher values indicating a faster + * connection. + * + * @param score the score value to set. + * @return the AzureReachabilityReportLatencyInfo object itself. + */ + public AzureReachabilityReportLatencyInfo withScore(Integer score) { + this.score = score; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java new file mode 100644 index 0000000000000..a5b556950a1dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define a geographic location. */ +@Fluent +public final class AzureReachabilityReportLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportLocation.class); + + /* + * The name of the country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /* + * The name of the state. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The name of the city or town. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Get the country property: The name of the country. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The name of the country. + * + * @param country the country value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state property: The name of the state. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The name of the state. + * + * @param state the state value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withState(String state) { + this.state = state; + return this; + } + + /** + * Get the city property: The name of the city or town. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The name of the city or town. + * + * @param city the city value to set. + * @return the AzureReachabilityReportLocation object itself. + */ + public AzureReachabilityReportLocation withCity(String city) { + this.city = city; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (country() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property country in model AzureReachabilityReportLocation")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java new file mode 100644 index 0000000000000..8768a964bc70d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Geographic and time constraints for Azure reachability report. */ +@Fluent +public final class AzureReachabilityReportParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureReachabilityReportParameters.class); + + /* + * Parameters that define a geographic location. + */ + @JsonProperty(value = "providerLocation", required = true) + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Internet service providers. + */ + @JsonProperty(value = "providers") + private List providers; + + /* + * Optional Azure regions to scope the query to. + */ + @JsonProperty(value = "azureLocations") + private List azureLocations; + + /* + * The start time for the Azure reachability report. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * The end time for the Azure reachability report. + */ + @JsonProperty(value = "endTime", required = true) + private OffsetDateTime endTime; + + /** + * Get the providerLocation property: Parameters that define a geographic location. + * + * @return the providerLocation value. + */ + public AzureReachabilityReportLocation providerLocation() { + return this.providerLocation; + } + + /** + * Set the providerLocation property: Parameters that define a geographic location. + * + * @param providerLocation the providerLocation value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviderLocation(AzureReachabilityReportLocation providerLocation) { + this.providerLocation = providerLocation; + return this; + } + + /** + * Get the providers property: List of Internet service providers. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: List of Internet service providers. + * + * @param providers the providers value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the azureLocations property: Optional Azure regions to scope the query to. + * + * @return the azureLocations value. + */ + public List azureLocations() { + return this.azureLocations; + } + + /** + * Set the azureLocations property: Optional Azure regions to scope the query to. + * + * @param azureLocations the azureLocations value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withAzureLocations(List azureLocations) { + this.azureLocations = azureLocations; + return this; + } + + /** + * Get the startTime property: The start time for the Azure reachability report. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time for the Azure reachability report. + * + * @param startTime the startTime value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time for the Azure reachability report. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time for the Azure reachability report. + * + * @param endTime the endTime value to set. + * @return the AzureReachabilityReportParameters object itself. + */ + public AzureReachabilityReportParameters withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providerLocation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportParameters")); + } else { + providerLocation().validate(); + } + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model AzureReachabilityReportParameters")); + } + if (endTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endTime in model AzureReachabilityReportParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java new file mode 100644 index 0000000000000..bb997605d6f3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; + +/** An immutable client-side representation of AzureWebCategory. */ +public interface AzureWebCategory { + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the group property: The name of the group that the category belongs to. + * + * @return the group value. + */ + String group(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner object. + * + * @return the inner object. + */ + AzureWebCategoryInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java new file mode 100644 index 0000000000000..9f1381eb28411 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListAzureWebCategories API service call. */ +@Fluent +public final class AzureWebCategoryListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureWebCategoryListResult.class); + + /* + * List of Azure Web Categories for a given Subscription. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Azure Web Categories for a given Subscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Azure Web Categories for a given Subscription. + * + * @param value the value value to set. + * @return the AzureWebCategoryListResult object itself. + */ + public AzureWebCategoryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AzureWebCategoryListResult object itself. + */ + public AzureWebCategoryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..48831d2b4af3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner object. + * + * @return the inner object. + */ + BackendAddressPoolInner innerModel(); + + /** The entirety of the BackendAddressPool definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BackendAddressPool definition stages. */ + interface DefinitionStages { + /** The first stage of the BackendAddressPool definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BackendAddressPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, loadBalancerName. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @return the next definition stage. + */ + WithCreate withExistingLoadBalancer(String resourceGroupName, String loadBalancerName); + } + /** + * The stage of the BackendAddressPool definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithName, + DefinitionStages.WithTunnelInterfaces, + DefinitionStages.WithLoadBalancerBackendAddresses { + /** + * Executes the create request. + * + * @return the created resource. + */ + BackendAddressPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BackendAddressPool create(Context context); + } + /** The stage of the BackendAddressPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the backend address pool. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the backend address pool. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the BackendAddressPool definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of backend address + * pools used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of backend address pools used by the + * load balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the BackendAddressPool definition allowing to specify tunnelInterfaces. */ + interface WithTunnelInterfaces { + /** + * Specifies the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces.. + * + * @param tunnelInterfaces An array of gateway load balancer tunnel interfaces. + * @return the next definition stage. + */ + WithCreate withTunnelInterfaces(List tunnelInterfaces); + } + /** The stage of the BackendAddressPool definition allowing to specify loadBalancerBackendAddresses. */ + interface WithLoadBalancerBackendAddresses { + /** + * Specifies the loadBalancerBackendAddresses property: An array of backend addresses.. + * + * @param loadBalancerBackendAddresses An array of backend addresses. + * @return the next definition stage. + */ + WithCreate withLoadBalancerBackendAddresses(List loadBalancerBackendAddresses); + } + } + /** + * Begins update for the BackendAddressPool resource. + * + * @return the stage of resource update. + */ + BackendAddressPool.Update update(); + + /** The template for BackendAddressPool update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTunnelInterfaces, + UpdateStages.WithLoadBalancerBackendAddresses { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BackendAddressPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BackendAddressPool apply(Context context); + } + /** The BackendAddressPool update stages. */ + interface UpdateStages { + /** The stage of the BackendAddressPool update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within the set of backend address + * pools used by the load balancer. This name can be used to access the resource.. + * + * @param name The name of the resource that is unique within the set of backend address pools used by the + * load balancer. This name can be used to access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the BackendAddressPool update allowing to specify tunnelInterfaces. */ + interface WithTunnelInterfaces { + /** + * Specifies the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces.. + * + * @param tunnelInterfaces An array of gateway load balancer tunnel interfaces. + * @return the next definition stage. + */ + Update withTunnelInterfaces(List tunnelInterfaces); + } + /** The stage of the BackendAddressPool update allowing to specify loadBalancerBackendAddresses. */ + interface WithLoadBalancerBackendAddresses { + /** + * Specifies the loadBalancerBackendAddresses property: An array of backend addresses.. + * + * @param loadBalancerBackendAddresses An array of backend addresses. + * @return the next definition stage. + */ + Update withLoadBalancerBackendAddresses(List loadBalancerBackendAddresses); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BackendAddressPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BackendAddressPool refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java new file mode 100644 index 0000000000000..9de110aad1318 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; + +/** An immutable client-side representation of BastionActiveSession. */ +public interface BastionActiveSession { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the startTime property: The time when the session started. + * + * @return the startTime value. + */ + Object startTime(); + + /** + * Gets the targetSubscriptionId property: The subscription id for the target virtual machine. + * + * @return the targetSubscriptionId value. + */ + String targetSubscriptionId(); + + /** + * Gets the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the targetHostname property: The host name of the target. + * + * @return the targetHostname value. + */ + String targetHostname(); + + /** + * Gets the targetResourceGroup property: The resource group of the target. + * + * @return the targetResourceGroup value. + */ + String targetResourceGroup(); + + /** + * Gets the username property: The user name who is active on this session. + * + * @return the username value. + */ + String username(); + + /** + * Gets the targetIpAddress property: The IP Address of the target. + * + * @return the targetIpAddress value. + */ + String targetIpAddress(); + + /** + * Gets the protocol property: The protocol used to connect to the target. + * + * @return the protocol value. + */ + BastionConnectProtocol protocol(); + + /** + * Gets the targetResourceId property: The resource id of the target. + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the sessionDurationInMins property: Duration in mins the session has been active. + * + * @return the sessionDurationInMins value. + */ + Float sessionDurationInMins(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner object. + * + * @return the inner object. + */ + BastionActiveSessionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java new file mode 100644 index 0000000000000..28385eaf414bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for GetActiveSessions. */ +@Fluent +public final class BastionActiveSessionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionActiveSessionListResult.class); + + /* + * List of active sessions on the bastion. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of active sessions on the bastion. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of active sessions on the bastion. + * + * @param value the value value to set. + * @return the BastionActiveSessionListResult object itself. + */ + public BastionActiveSessionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionActiveSessionListResult object itself. + */ + public BastionActiveSessionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java new file mode 100644 index 0000000000000..0ccab2a4a70e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BastionConnectProtocol. */ +public final class BastionConnectProtocol extends ExpandableStringEnum { + /** Static value SSH for BastionConnectProtocol. */ + public static final BastionConnectProtocol SSH = fromString("SSH"); + + /** Static value RDP for BastionConnectProtocol. */ + public static final BastionConnectProtocol RDP = fromString("RDP"); + + /** + * Creates or finds a BastionConnectProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionConnectProtocol. + */ + @JsonCreator + public static BastionConnectProtocol fromString(String name) { + return fromString(name, BastionConnectProtocol.class); + } + + /** @return known BastionConnectProtocol values. */ + public static Collection values() { + return values(BastionConnectProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java new file mode 100644 index 0000000000000..b0d453ba77908 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.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.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 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..298d4a1878adb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration of an Bastion Host. */ +@Fluent +public final class BastionHostIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostIpConfiguration.class); + + /* + * 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; + + /** + * 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..fb27b2bf116a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBastionHosts API service call. */ +@Fluent +public final class BastionHostListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionHostListResult.class); + + /* + * List of Bastion Hosts in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Bastion Hosts in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Bastion Hosts in a resource group. + * + * @param value the value value to set. + * @return the BastionHostListResult object itself. + */ + public BastionHostListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionHostListResult object itself. + */ + public BastionHostListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java new file mode 100644 index 0000000000000..72f35702ed161 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BastionHostSkuName. */ +public final class BastionHostSkuName extends ExpandableStringEnum { + /** Static value Basic for BastionHostSkuName. */ + public static final BastionHostSkuName BASIC = fromString("Basic"); + + /** Static value Standard for BastionHostSkuName. */ + public static final BastionHostSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a BastionHostSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionHostSkuName. + */ + @JsonCreator + public static BastionHostSkuName fromString(String name) { + return fromString(name, BastionHostSkuName.class); + } + + /** @return known BastionHostSkuName values. */ + public static Collection values() { + return values(BastionHostSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java new file mode 100644 index 0000000000000..5dac52be6e13e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BastionHosts. */ +public interface BastionHosts { + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Deletes the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String bastionHostname, Context context); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host. + */ + BastionHost getByResourceGroup(String resourceGroupName, String bastionHostname); + + /** + * Gets the specified Bastion Host. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Lists all Bastion Hosts in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + PagedIterable list(); + + /** + * Lists all Bastion Hosts in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + PagedIterable list(Context context); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Bastion Hosts in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified Bastion Host. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Bastion Host 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..23ef544881069 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for DisconnectActiveSessions. */ +@Fluent +public final class BastionSessionDeleteResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionSessionDeleteResult.class); + + /* + * List of sessions with their corresponding state. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of sessions with their corresponding state. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of sessions with their corresponding state. + * + * @param value the value value to set. + * @return the BastionSessionDeleteResult object itself. + */ + public BastionSessionDeleteResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionSessionDeleteResult object itself. + */ + public BastionSessionDeleteResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java new file mode 100644 index 0000000000000..c8caf45ea8b1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; + +/** An immutable client-side representation of BastionSessionState. */ +public interface BastionSessionState { + /** + * Gets the sessionId property: A unique id for the session. + * + * @return the sessionId value. + */ + String sessionId(); + + /** + * Gets the message property: Used for extra information. + * + * @return the message value. + */ + String message(); + + /** + * Gets the state property: The state of the session. Disconnected/Failed/NotFound. + * + * @return the state value. + */ + String state(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner object. + * + * @return the inner object. + */ + BastionSessionStateInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java new file mode 100644 index 0000000000000..d48f19c935d7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; + +/** An immutable client-side representation of BastionShareableLink. */ +public interface BastionShareableLink { + /** + * Gets the vm property: Reference of the virtual machine resource. + * + * @return the vm value. + */ + VM vm(); + + /** + * Gets the bsl property: The unique Bastion Shareable Link to the virtual machine. + * + * @return the bsl value. + */ + String bsl(); + + /** + * Gets the createdAt property: The time when the link was created. + * + * @return the createdAt value. + */ + String createdAt(); + + /** + * Gets the message property: Optional field indicating the warning or error message related to the vm in case of + * partial failure. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner object. + * + * @return the inner object. + */ + BastionShareableLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java new file mode 100644 index 0000000000000..3c0934424bd30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Post request for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkListRequest.class); + + /* + * List of VM references. + */ + @JsonProperty(value = "vms") + private List vms; + + /** + * Get the vms property: List of VM references. + * + * @return the vms value. + */ + public List vms() { + return this.vms; + } + + /** + * Set the vms property: List of VM references. + * + * @param vms the vms value to set. + * @return the BastionShareableLinkListRequest object itself. + */ + public BastionShareableLinkListRequest withVms(List vms) { + this.vms = vms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vms() != null) { + vms().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java new file mode 100644 index 0000000000000..6e06ff53ddcb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for all the Bastion Shareable Link endpoints. */ +@Fluent +public final class BastionShareableLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BastionShareableLinkListResult.class); + + /* + * List of Bastion Shareable Links for the request. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Bastion Shareable Links for the request. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Bastion Shareable Links for the request. + * + * @param value the value value to set. + * @return the BastionShareableLinkListResult object itself. + */ + public BastionShareableLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BastionShareableLinkListResult object itself. + */ + public BastionShareableLinkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java new file mode 100644 index 0000000000000..8d9480c4c4fa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains bgp community information offered in Service Community resources. */ +@Fluent +public final class BgpCommunity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpCommunity.class); + + /* + * The region which the service support. e.g. For O365, region is Global. + */ + @JsonProperty(value = "serviceSupportedRegion") + private String serviceSupportedRegion; + + /* + * The name of the bgp community. e.g. Skype. + */ + @JsonProperty(value = "communityName") + private String communityName; + + /* + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + @JsonProperty(value = "communityValue") + private String communityValue; + + /* + * The prefixes that the bgp community contains. + */ + @JsonProperty(value = "communityPrefixes") + private List communityPrefixes; + + /* + * Customer is authorized to use bgp community or not. + */ + @JsonProperty(value = "isAuthorizedToUse") + private Boolean isAuthorizedToUse; + + /* + * The service group of the bgp community contains. + */ + @JsonProperty(value = "serviceGroup") + private String serviceGroup; + + /** + * Get the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. + * + * @return the serviceSupportedRegion value. + */ + public String serviceSupportedRegion() { + return this.serviceSupportedRegion; + } + + /** + * Set the serviceSupportedRegion property: The region which the service support. e.g. For O365, region is Global. + * + * @param serviceSupportedRegion the serviceSupportedRegion value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withServiceSupportedRegion(String serviceSupportedRegion) { + this.serviceSupportedRegion = serviceSupportedRegion; + return this; + } + + /** + * Get the communityName property: The name of the bgp community. e.g. Skype. + * + * @return the communityName value. + */ + public String communityName() { + return this.communityName; + } + + /** + * Set the communityName property: The name of the bgp community. e.g. Skype. + * + * @param communityName the communityName value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityName(String communityName) { + this.communityName = communityName; + return this; + } + + /** + * Get the communityValue property: The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @return the communityValue value. + */ + public String communityValue() { + return this.communityValue; + } + + /** + * Set the communityValue property: The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + * + * @param communityValue the communityValue value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityValue(String communityValue) { + this.communityValue = communityValue; + return this; + } + + /** + * Get the communityPrefixes property: The prefixes that the bgp community contains. + * + * @return the communityPrefixes value. + */ + public List communityPrefixes() { + return this.communityPrefixes; + } + + /** + * Set the communityPrefixes property: The prefixes that the bgp community contains. + * + * @param communityPrefixes the communityPrefixes value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withCommunityPrefixes(List communityPrefixes) { + this.communityPrefixes = communityPrefixes; + return this; + } + + /** + * Get the isAuthorizedToUse property: Customer is authorized to use bgp community or not. + * + * @return the isAuthorizedToUse value. + */ + public Boolean isAuthorizedToUse() { + return this.isAuthorizedToUse; + } + + /** + * Set the isAuthorizedToUse property: Customer is authorized to use bgp community or not. + * + * @param isAuthorizedToUse the isAuthorizedToUse value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withIsAuthorizedToUse(Boolean isAuthorizedToUse) { + this.isAuthorizedToUse = isAuthorizedToUse; + return this; + } + + /** + * Get the serviceGroup property: The service group of the bgp community contains. + * + * @return the serviceGroup value. + */ + public String serviceGroup() { + return this.serviceGroup; + } + + /** + * Set the serviceGroup property: The service group of the bgp community contains. + * + * @param serviceGroup the serviceGroup value to set. + * @return the BgpCommunity object itself. + */ + public BgpCommunity withServiceGroup(String serviceGroup) { + this.serviceGroup = serviceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java new file mode 100644 index 0000000000000..cb0706d5dd747 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.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.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 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..3b19922cc44b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BgpPeerState. */ +public final class BgpPeerState extends ExpandableStringEnum { + /** Static value Unknown for BgpPeerState. */ + public static final BgpPeerState UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for BgpPeerState. */ + public static final BgpPeerState STOPPED = fromString("Stopped"); + + /** Static value Idle for BgpPeerState. */ + public static final BgpPeerState IDLE = fromString("Idle"); + + /** Static value Connecting for BgpPeerState. */ + public static final BgpPeerState CONNECTING = fromString("Connecting"); + + /** Static value Connected for BgpPeerState. */ + public static final BgpPeerState CONNECTED = fromString("Connected"); + + /** + * Creates or finds a BgpPeerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BgpPeerState. + */ + @JsonCreator + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** @return known BgpPeerState values. */ + public static Collection values() { + return values(BgpPeerState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java new file mode 100644 index 0000000000000..7bf62132eb235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BGP peer status details. */ +@Immutable +public final class BgpPeerStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpPeerStatus.class); + + /* + * The virtual network gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The remote BGP peer. + */ + @JsonProperty(value = "neighbor", access = JsonProperty.Access.WRITE_ONLY) + private String neighbor; + + /* + * The autonomous system number of the remote BGP peer. + */ + @JsonProperty(value = "asn", access = JsonProperty.Access.WRITE_ONLY) + private Long asn; + + /* + * The BGP peer state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private BgpPeerState state; + + /* + * For how long the peering has been up. + */ + @JsonProperty(value = "connectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String connectedDuration; + + /* + * The number of routes learned from this peer. + */ + @JsonProperty(value = "routesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long routesReceived; + + /* + * The number of BGP messages sent. + */ + @JsonProperty(value = "messagesSent", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesSent; + + /* + * The number of BGP messages received. + */ + @JsonProperty(value = "messagesReceived", access = JsonProperty.Access.WRITE_ONLY) + private Long messagesReceived; + + /** + * Get the localAddress property: The virtual network gateway's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the neighbor property: The remote BGP peer. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Get the asn property: The autonomous system number of the remote BGP peer. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Get the state property: The BGP peer state. + * + * @return the state value. + */ + public BgpPeerState state() { + return this.state; + } + + /** + * Get the connectedDuration property: For how long the peering has been up. + * + * @return the connectedDuration value. + */ + public String connectedDuration() { + return this.connectedDuration; + } + + /** + * Get the routesReceived property: The number of routes learned from this peer. + * + * @return the routesReceived value. + */ + public Long routesReceived() { + return this.routesReceived; + } + + /** + * Get the messagesSent property: The number of BGP messages sent. + * + * @return the messagesSent value. + */ + public Long messagesSent() { + return this.messagesSent; + } + + /** + * Get the messagesReceived property: The number of BGP messages received. + * + * @return the messagesReceived value. + */ + public Long messagesReceived() { + return this.messagesReceived; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java new file mode 100644 index 0000000000000..dcff9d96ec080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner; +import java.util.List; + +/** An immutable client-side representation of BgpPeerStatusListResult. */ +public interface BgpPeerStatusListResult { + /** + * Gets the value property: List of BGP peers. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BgpPeerStatusListResultInner object. + * + * @return the inner object. + */ + BgpPeerStatusListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java new file mode 100644 index 0000000000000..ac882616b43e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of BgpServiceCommunities. */ +public interface BgpServiceCommunities { + /** + * Gets all the available bgp service communities. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + PagedIterable list(); + + /** + * Gets all the available bgp service communities. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available bgp service communities. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.java new file mode 100644 index 0000000000000..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..b2bbc1f87dd48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListServiceCommunity API service call. */ +@Fluent +public final class BgpServiceCommunityListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpServiceCommunityListResult.class); + + /* + * A list of service community resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of service community resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of service community resources. + * + * @param value the value value to set. + * @return the BgpServiceCommunityListResult object itself. + */ + public BgpServiceCommunityListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the BgpServiceCommunityListResult object itself. + */ + public BgpServiceCommunityListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java new file mode 100644 index 0000000000000..8990565e8bcc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BGP settings details. */ +@Fluent +public final class BgpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpSettings.class); + + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /* + * The weight added to routes learned from this BGP speaker. + */ + @JsonProperty(value = "peerWeight") + private Integer peerWeight; + + /* + * BGP peering address with IP configuration ID for virtual network + * gateway. + */ + @JsonProperty(value = "bgpPeeringAddresses") + private List bgpPeeringAddresses; + + /** + * Get the asn property: The BGP speaker's ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Set the asn property: The BGP speaker's ASN. + * + * @param asn the asn value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value. + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Get the peerWeight property: The weight added to routes learned from this BGP speaker. + * + * @return the peerWeight value. + */ + public Integer peerWeight() { + return this.peerWeight; + } + + /** + * Set the peerWeight property: The weight added to routes learned from this BGP speaker. + * + * @param peerWeight the peerWeight value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withPeerWeight(Integer peerWeight) { + this.peerWeight = peerWeight; + return this; + } + + /** + * Get the bgpPeeringAddresses property: BGP peering address with IP configuration ID for virtual network gateway. + * + * @return the bgpPeeringAddresses value. + */ + public List bgpPeeringAddresses() { + return this.bgpPeeringAddresses; + } + + /** + * Set the bgpPeeringAddresses property: BGP peering address with IP configuration ID for virtual network gateway. + * + * @param bgpPeeringAddresses the bgpPeeringAddresses value to set. + * @return the BgpSettings object itself. + */ + public BgpSettings withBgpPeeringAddresses(List bgpPeeringAddresses) { + this.bgpPeeringAddresses = bgpPeeringAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bgpPeeringAddresses() != null) { + bgpPeeringAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java new file mode 100644 index 0000000000000..f11c1ac3a20ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class BreakOutCategoryPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BreakOutCategoryPolicies.class); + + /* + * Flag to control breakout of o365 allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control breakout of o365 optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control breakout of o365 default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** + * Get the allow property: Flag to control breakout of o365 allow category. + * + * @return the allow value. + */ + public Boolean allow() { + return this.allow; + } + + /** + * Set the allow property: Flag to control breakout of o365 allow category. + * + * @param allow the allow value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withAllow(Boolean allow) { + this.allow = allow; + return this; + } + + /** + * Get the optimize property: Flag to control breakout of o365 optimize category. + * + * @return the optimize value. + */ + public Boolean optimize() { + return this.optimize; + } + + /** + * Set the optimize property: Flag to control breakout of o365 optimize category. + * + * @param optimize the optimize value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withOptimize(Boolean optimize) { + this.optimize = optimize; + return this; + } + + /** + * Get the defaultProperty property: Flag to control breakout of o365 default category. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Flag to control breakout of o365 default category. + * + * @param defaultProperty the defaultProperty value to set. + * @return the BreakOutCategoryPolicies object itself. + */ + public BreakOutCategoryPolicies withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java new file mode 100644 index 0000000000000..ace34837f8058 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request body of the CheckPrivateLinkServiceVisibility API service call. */ +@Fluent +public final class CheckPrivateLinkServiceVisibilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckPrivateLinkServiceVisibilityRequest.class); + + /* + * The alias of the private link service. + */ + @JsonProperty(value = "privateLinkServiceAlias") + private String privateLinkServiceAlias; + + /** + * Get the privateLinkServiceAlias property: The alias of the private link service. + * + * @return the privateLinkServiceAlias value. + */ + public String privateLinkServiceAlias() { + return this.privateLinkServiceAlias; + } + + /** + * Set the privateLinkServiceAlias property: The alias of the private link service. + * + * @param privateLinkServiceAlias the privateLinkServiceAlias value to set. + * @return the CheckPrivateLinkServiceVisibilityRequest object itself. + */ + public CheckPrivateLinkServiceVisibilityRequest withPrivateLinkServiceAlias(String privateLinkServiceAlias) { + this.privateLinkServiceAlias = privateLinkServiceAlias; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java new file mode 100644 index 0000000000000..f00513510693b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CircuitConnectionStatus. */ +public final class CircuitConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for CircuitConnectionStatus. */ + public static final CircuitConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CircuitConnectionStatus. + */ + @JsonCreator + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** @return known CircuitConnectionStatus values. */ + public static Collection values() { + return values(CircuitConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java new file mode 100644 index 0000000000000..f3bfaf15e5792 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CommissionedState. */ +public final class CommissionedState extends ExpandableStringEnum { + /** Static value Provisioning for CommissionedState. */ + public static final CommissionedState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for CommissionedState. */ + public static final CommissionedState PROVISIONED = fromString("Provisioned"); + + /** Static value Commissioning for CommissionedState. */ + public static final CommissionedState COMMISSIONING = fromString("Commissioning"); + + /** Static value Commissioned for CommissionedState. */ + public static final CommissionedState COMMISSIONED = fromString("Commissioned"); + + /** Static value Decommissioning for CommissionedState. */ + public static final CommissionedState DECOMMISSIONING = fromString("Decommissioning"); + + /** Static value Deprovisioning for CommissionedState. */ + public static final CommissionedState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a CommissionedState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommissionedState. + */ + @JsonCreator + public static CommissionedState fromString(String name) { + return fromString(name, CommissionedState.class); + } + + /** @return known CommissionedState values. */ + public static Collection values() { + return values(CommissionedState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java new file mode 100644 index 0000000000000..79f18d43a971c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitor.class); + + /* + * 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(); + + /** + * 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java new file mode 100644 index 0000000000000..437699c6b8094 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the destination of connection monitor. */ +@Fluent +public final class ConnectionMonitorDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorDestination.class); + + /* + * The ID of the resource used as the destination by connection monitor. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor destination (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * The destination port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource used as the destination by connection monitor. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource used as the destination by connection monitor. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: Address of the connection monitor destination (IP or domain name). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor destination (IP or domain name). + * + * @param address the address value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: The destination port used by connection monitor. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The destination port used by connection monitor. + * + * @param port the port value to set. + * @return the ConnectionMonitorDestination object itself. + */ + public ConnectionMonitorDestination withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java new file mode 100644 index 0000000000000..08e0c40a62aa1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint. */ +@Fluent +public final class ConnectionMonitorEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpoint.class); + + /* + * The name of the connection monitor endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The endpoint type. + */ + @JsonProperty(value = "type") + private EndpointType type; + + /* + * Resource ID of the connection monitor endpoint. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Address of the connection monitor endpoint (IP or domain name). + */ + @JsonProperty(value = "address") + private String address; + + /* + * Filter for sub-items within the endpoint. + */ + @JsonProperty(value = "filter") + private ConnectionMonitorEndpointFilter filter; + + /* + * Endpoint scope. + */ + @JsonProperty(value = "scope") + private ConnectionMonitorEndpointScope scope; + + /* + * Test coverage for the endpoint. + */ + @JsonProperty(value = "coverageLevel") + private CoverageLevel coverageLevel; + + /** + * Get the name property: The name of the connection monitor endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor endpoint. + * + * @param name the name value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The endpoint type. + * + * @return the type value. + */ + public EndpointType type() { + return this.type; + } + + /** + * Set the type property: The endpoint type. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withType(EndpointType type) { + this.type = type; + return this; + } + + /** + * Get the resourceId property: Resource ID of the connection monitor endpoint. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the connection monitor endpoint. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor endpoint (IP or domain name). + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the filter property: Filter for sub-items within the endpoint. + * + * @return the filter value. + */ + public ConnectionMonitorEndpointFilter filter() { + return this.filter; + } + + /** + * Set the filter property: Filter for sub-items within the endpoint. + * + * @param filter the filter value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withFilter(ConnectionMonitorEndpointFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the scope property: Endpoint scope. + * + * @return the scope value. + */ + public ConnectionMonitorEndpointScope scope() { + return this.scope; + } + + /** + * Set the scope property: Endpoint scope. + * + * @param scope the scope value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withScope(ConnectionMonitorEndpointScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the coverageLevel property: Test coverage for the endpoint. + * + * @return the coverageLevel value. + */ + public CoverageLevel coverageLevel() { + return this.coverageLevel; + } + + /** + * Set the coverageLevel property: Test coverage for the endpoint. + * + * @param coverageLevel the coverageLevel value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withCoverageLevel(CoverageLevel coverageLevel) { + this.coverageLevel = coverageLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ConnectionMonitorEndpoint")); + } + if (filter() != null) { + filter().validate(); + } + if (scope() != null) { + scope().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java new file mode 100644 index 0000000000000..245cbcc791270 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor endpoint filter. */ +@Fluent +public final class ConnectionMonitorEndpointFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointFilter.class); + + /* + * The behavior of the endpoint filter. Currently only 'Include' is + * supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterType type; + + /* + * List of items in the filter. + */ + @JsonProperty(value = "items") + private List items; + + /** + * Get the type property: The behavior of the endpoint filter. Currently only 'Include' is supported. + * + * @return the type value. + */ + public ConnectionMonitorEndpointFilterType type() { + return this.type; + } + + /** + * Set the type property: The behavior of the endpoint filter. Currently only 'Include' is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpointFilter object itself. + */ + public ConnectionMonitorEndpointFilter withType(ConnectionMonitorEndpointFilterType type) { + this.type = type; + return this; + } + + /** + * Get the items property: List of items in the filter. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: List of items in the filter. + * + * @param items the items value to set. + * @return the ConnectionMonitorEndpointFilter object itself. + */ + public ConnectionMonitorEndpointFilter withItems(List items) { + this.items = items; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (items() != null) { + items().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java new file mode 100644 index 0000000000000..1d49cfd5532ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint filter item. */ +@Fluent +public final class ConnectionMonitorEndpointFilterItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointFilterItem.class); + + /* + * The type of item included in the filter. Currently only 'AgentAddress' + * is supported. + */ + @JsonProperty(value = "type") + private ConnectionMonitorEndpointFilterItemType type; + + /* + * The address of the filter item. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the type property: The type of item included in the filter. Currently only 'AgentAddress' is supported. + * + * @return the type value. + */ + public ConnectionMonitorEndpointFilterItemType type() { + return this.type; + } + + /** + * Set the type property: The type of item included in the filter. Currently only 'AgentAddress' is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorEndpointFilterItem object itself. + */ + public ConnectionMonitorEndpointFilterItem withType(ConnectionMonitorEndpointFilterItemType type) { + this.type = type; + return this; + } + + /** + * Get the address property: The address of the filter item. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The address of the filter item. + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpointFilterItem object itself. + */ + public ConnectionMonitorEndpointFilterItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java new file mode 100644 index 0000000000000..f06310755785f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorEndpointFilterItemType. */ +public final class ConnectionMonitorEndpointFilterItemType + extends ExpandableStringEnum { + /** Static value AgentAddress for ConnectionMonitorEndpointFilterItemType. */ + public static final ConnectionMonitorEndpointFilterItemType AGENT_ADDRESS = fromString("AgentAddress"); + + /** + * Creates or finds a ConnectionMonitorEndpointFilterItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterItemType. + */ + @JsonCreator + public static ConnectionMonitorEndpointFilterItemType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterItemType.class); + } + + /** @return known ConnectionMonitorEndpointFilterItemType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterItemType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java new file mode 100644 index 0000000000000..be3915ec316dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorEndpointFilterType. */ +public final class ConnectionMonitorEndpointFilterType + extends ExpandableStringEnum { + /** Static value Include for ConnectionMonitorEndpointFilterType. */ + public static final ConnectionMonitorEndpointFilterType INCLUDE = fromString("Include"); + + /** + * Creates or finds a ConnectionMonitorEndpointFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterType. + */ + @JsonCreator + public static ConnectionMonitorEndpointFilterType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterType.class); + } + + /** @return known ConnectionMonitorEndpointFilterType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java new file mode 100644 index 0000000000000..a7c9a3fefd99b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor endpoint scope. */ +@Fluent +public final class ConnectionMonitorEndpointScope { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointScope.class); + + /* + * List of items which needs to be included to the endpoint scope. + */ + @JsonProperty(value = "include") + private List include; + + /* + * List of items which needs to be excluded from the endpoint scope. + */ + @JsonProperty(value = "exclude") + private List exclude; + + /** + * Get the include property: List of items which needs to be included to the endpoint scope. + * + * @return the include value. + */ + public List include() { + return this.include; + } + + /** + * Set the include property: List of items which needs to be included to the endpoint scope. + * + * @param include the include value to set. + * @return the ConnectionMonitorEndpointScope object itself. + */ + public ConnectionMonitorEndpointScope withInclude(List include) { + this.include = include; + return this; + } + + /** + * Get the exclude property: List of items which needs to be excluded from the endpoint scope. + * + * @return the exclude value. + */ + public List exclude() { + return this.exclude; + } + + /** + * Set the exclude property: List of items which needs to be excluded from the endpoint scope. + * + * @param exclude the exclude value to set. + * @return the ConnectionMonitorEndpointScope object itself. + */ + public ConnectionMonitorEndpointScope withExclude(List exclude) { + this.exclude = exclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (include() != null) { + include().forEach(e -> e.validate()); + } + if (exclude() != null) { + exclude().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java new file mode 100644 index 0000000000000..b7f28b55fae3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the connection monitor endpoint scope item. */ +@Fluent +public final class ConnectionMonitorEndpointScopeItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorEndpointScopeItem.class); + + /* + * The address of the endpoint item. Supported types are IPv4/IPv6 subnet + * mask or IPv4/IPv6 IP address. + */ + @JsonProperty(value = "address") + private String address; + + /** + * Get the address property: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + * IPv4/IPv6 IP address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or + * IPv4/IPv6 IP address. + * + * @param address the address value to set. + * @return the ConnectionMonitorEndpointScopeItem object itself. + */ + public ConnectionMonitorEndpointScopeItem withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java new file mode 100644 index 0000000000000..f25f5f4a2cc7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the HTTP configuration. */ +@Fluent +public final class ConnectionMonitorHttpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorHttpConfiguration.class); + + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The HTTP method to use. + */ + @JsonProperty(value = "method") + private HttpConfigurationMethod method; + + /* + * The path component of the URI. For instance, "/dir1/dir2". + */ + @JsonProperty(value = "path") + private String path; + + /* + * The HTTP headers to transmit with the request. + */ + @JsonProperty(value = "requestHeaders") + private List requestHeaders; + + /* + * HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + */ + @JsonProperty(value = "validStatusCodeRanges") + private List validStatusCodeRanges; + + /* + * Value indicating whether HTTPS is preferred over HTTP in cases where the + * choice is not explicit. + */ + @JsonProperty(value = "preferHTTPS") + private Boolean preferHttps; + + /** + * Get the port property: The port to connect to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port to connect to. + * + * @param port the port value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the method property: The HTTP method to use. + * + * @return the method value. + */ + public HttpConfigurationMethod method() { + return this.method; + } + + /** + * Set the method property: The HTTP method to use. + * + * @param method the method value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withMethod(HttpConfigurationMethod method) { + this.method = method; + return this; + } + + /** + * Get the path property: The path component of the URI. For instance, "/dir1/dir2". + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path component of the URI. For instance, "/dir1/dir2". + * + * @param path the path value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the requestHeaders property: The HTTP headers to transmit with the request. + * + * @return the requestHeaders value. + */ + public List requestHeaders() { + return this.requestHeaders; + } + + /** + * Set the requestHeaders property: The HTTP headers to transmit with the request. + * + * @param requestHeaders the requestHeaders value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withRequestHeaders(List requestHeaders) { + this.requestHeaders = requestHeaders; + return this; + } + + /** + * Get the validStatusCodeRanges property: HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + * + * @return the validStatusCodeRanges value. + */ + public List validStatusCodeRanges() { + return this.validStatusCodeRanges; + } + + /** + * Set the validStatusCodeRanges property: HTTP status codes to consider successful. For instance, + * "2xx,301-304,418". + * + * @param validStatusCodeRanges the validStatusCodeRanges value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withValidStatusCodeRanges(List validStatusCodeRanges) { + this.validStatusCodeRanges = validStatusCodeRanges; + return this; + } + + /** + * Get the preferHttps property: Value indicating whether HTTPS is preferred over HTTP in cases where the choice is + * not explicit. + * + * @return the preferHttps value. + */ + public Boolean preferHttps() { + return this.preferHttps; + } + + /** + * Set the preferHttps property: Value indicating whether HTTPS is preferred over HTTP in cases where the choice is + * not explicit. + * + * @param preferHttps the preferHttps value to set. + * @return the ConnectionMonitorHttpConfiguration object itself. + */ + public ConnectionMonitorHttpConfiguration withPreferHttps(Boolean preferHttps) { + this.preferHttps = preferHttps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (requestHeaders() != null) { + requestHeaders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java new file mode 100644 index 0000000000000..4e3914b1e65c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the ICMP configuration. */ +@Fluent +public final class ConnectionMonitorIcmpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorIcmpConfiguration.class); + + /* + * Value indicating whether path evaluation with trace route should be + * disabled. + */ + @JsonProperty(value = "disableTraceRoute") + private Boolean disableTraceRoute; + + /** + * Get the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @return the disableTraceRoute value. + */ + public Boolean disableTraceRoute() { + return this.disableTraceRoute; + } + + /** + * Set the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @param disableTraceRoute the disableTraceRoute value to set. + * @return the ConnectionMonitorIcmpConfiguration object itself. + */ + public ConnectionMonitorIcmpConfiguration withDisableTraceRoute(Boolean disableTraceRoute) { + this.disableTraceRoute = disableTraceRoute; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java new file mode 100644 index 0000000000000..e3373b0050a64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of connection monitors. */ +@Fluent +public final class ConnectionMonitorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorListResult.class); + + /* + * Information about connection monitors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Information about connection monitors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about connection monitors. + * + * @param value the value value to set. + * @return the ConnectionMonitorListResult object itself. + */ + public ConnectionMonitorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java new file mode 100644 index 0000000000000..7510390b8fd48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a connection monitor output destination. */ +@Fluent +public final class ConnectionMonitorOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorOutput.class); + + /* + * Connection monitor output destination type. Currently, only "Workspace" + * is supported. + */ + @JsonProperty(value = "type") + private OutputType type; + + /* + * Describes the settings for producing output into a log analytics + * workspace. + */ + @JsonProperty(value = "workspaceSettings") + private ConnectionMonitorWorkspaceSettings workspaceSettings; + + /** + * Get the type property: Connection monitor output destination type. Currently, only "Workspace" is supported. + * + * @return the type value. + */ + public OutputType type() { + return this.type; + } + + /** + * Set the type property: Connection monitor output destination type. Currently, only "Workspace" is supported. + * + * @param type the type value to set. + * @return the ConnectionMonitorOutput object itself. + */ + public ConnectionMonitorOutput withType(OutputType type) { + this.type = type; + return this; + } + + /** + * Get the workspaceSettings property: Describes the settings for producing output into a log analytics workspace. + * + * @return the workspaceSettings value. + */ + public ConnectionMonitorWorkspaceSettings workspaceSettings() { + return this.workspaceSettings; + } + + /** + * Set the workspaceSettings property: Describes the settings for producing output into a log analytics workspace. + * + * @param workspaceSettings the workspaceSettings value to set. + * @return the ConnectionMonitorOutput object itself. + */ + public ConnectionMonitorOutput withWorkspaceSettings(ConnectionMonitorWorkspaceSettings workspaceSettings) { + this.workspaceSettings = workspaceSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaceSettings() != null) { + workspaceSettings().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..f7bcd29666a8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ConnectionMonitorResult. */ +public interface ConnectionMonitorResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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..18975f2297000 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the source of connection monitor. */ +@Fluent +public final class ConnectionMonitorSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorSource.class); + + /* + * The ID of the resource used as the source by connection monitor. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port used by connection monitor. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource used as the source by connection monitor. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource used as the source by connection monitor. + * + * @param resourceId the resourceId value to set. + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the port property: The source port used by connection monitor. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The source port used by connection monitor. + * + * @param port the port value to set. + * @return the ConnectionMonitorSource object itself. + */ + public ConnectionMonitorSource withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceId in model ConnectionMonitorSource")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java new file mode 100644 index 0000000000000..9add73fa7ff58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorSourceStatus. */ +public final class ConnectionMonitorSourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Active for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ConnectionMonitorSourceStatus. */ + public static final ConnectionMonitorSourceStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorSourceStatus. + */ + @JsonCreator + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** @return known ConnectionMonitorSourceStatus values. */ + public static Collection values() { + return values(ConnectionMonitorSourceStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java new file mode 100644 index 0000000000000..0228a0320d461 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the threshold for declaring a test successful. */ +@Fluent +public final class ConnectionMonitorSuccessThreshold { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorSuccessThreshold.class); + + /* + * The maximum percentage of failed checks permitted for a test to evaluate + * as successful. + */ + @JsonProperty(value = "checksFailedPercent") + private Integer checksFailedPercent; + + /* + * The maximum round-trip time in milliseconds permitted for a test to + * evaluate as successful. + */ + @JsonProperty(value = "roundTripTimeMs") + private Float roundTripTimeMs; + + /** + * Get the checksFailedPercent property: The maximum percentage of failed checks permitted for a test to evaluate as + * successful. + * + * @return the checksFailedPercent value. + */ + public Integer checksFailedPercent() { + return this.checksFailedPercent; + } + + /** + * Set the checksFailedPercent property: The maximum percentage of failed checks permitted for a test to evaluate as + * successful. + * + * @param checksFailedPercent the checksFailedPercent value to set. + * @return the ConnectionMonitorSuccessThreshold object itself. + */ + public ConnectionMonitorSuccessThreshold withChecksFailedPercent(Integer checksFailedPercent) { + this.checksFailedPercent = checksFailedPercent; + return this; + } + + /** + * Get the roundTripTimeMs property: The maximum round-trip time in milliseconds permitted for a test to evaluate as + * successful. + * + * @return the roundTripTimeMs value. + */ + public Float roundTripTimeMs() { + return this.roundTripTimeMs; + } + + /** + * Set the roundTripTimeMs property: The maximum round-trip time in milliseconds permitted for a test to evaluate as + * successful. + * + * @param roundTripTimeMs the roundTripTimeMs value to set. + * @return the ConnectionMonitorSuccessThreshold object itself. + */ + public ConnectionMonitorSuccessThreshold withRoundTripTimeMs(Float roundTripTimeMs) { + this.roundTripTimeMs = roundTripTimeMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java new file mode 100644 index 0000000000000..f4b1db48e5f45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the TCP configuration. */ +@Fluent +public final class ConnectionMonitorTcpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTcpConfiguration.class); + + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Value indicating whether path evaluation with trace route should be + * disabled. + */ + @JsonProperty(value = "disableTraceRoute") + private Boolean disableTraceRoute; + + /* + * Destination port behavior. + */ + @JsonProperty(value = "destinationPortBehavior") + private DestinationPortBehavior destinationPortBehavior; + + /** + * Get the port property: The port to connect to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port to connect to. + * + * @param port the port value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @return the disableTraceRoute value. + */ + public Boolean disableTraceRoute() { + return this.disableTraceRoute; + } + + /** + * Set the disableTraceRoute property: Value indicating whether path evaluation with trace route should be disabled. + * + * @param disableTraceRoute the disableTraceRoute value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withDisableTraceRoute(Boolean disableTraceRoute) { + this.disableTraceRoute = disableTraceRoute; + return this; + } + + /** + * Get the destinationPortBehavior property: Destination port behavior. + * + * @return the destinationPortBehavior value. + */ + public DestinationPortBehavior destinationPortBehavior() { + return this.destinationPortBehavior; + } + + /** + * Set the destinationPortBehavior property: Destination port behavior. + * + * @param destinationPortBehavior the destinationPortBehavior value to set. + * @return the ConnectionMonitorTcpConfiguration object itself. + */ + public ConnectionMonitorTcpConfiguration withDestinationPortBehavior( + DestinationPortBehavior destinationPortBehavior) { + this.destinationPortBehavior = destinationPortBehavior; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java new file mode 100644 index 0000000000000..7828d6f1da15d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a connection monitor test configuration. */ +@Fluent +public final class ConnectionMonitorTestConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTestConfiguration.class); + + /* + * The name of the connection monitor test configuration. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The frequency of test evaluation, in seconds. + */ + @JsonProperty(value = "testFrequencySec") + private Integer testFrequencySec; + + /* + * The protocol to use in test evaluation. + */ + @JsonProperty(value = "protocol", required = true) + private ConnectionMonitorTestConfigurationProtocol protocol; + + /* + * The preferred IP version to use in test evaluation. The connection + * monitor may choose to use a different version depending on other + * parameters. + */ + @JsonProperty(value = "preferredIPVersion") + private PreferredIpVersion preferredIpVersion; + + /* + * The parameters used to perform test evaluation over HTTP. + */ + @JsonProperty(value = "httpConfiguration") + private ConnectionMonitorHttpConfiguration httpConfiguration; + + /* + * The parameters used to perform test evaluation over TCP. + */ + @JsonProperty(value = "tcpConfiguration") + private ConnectionMonitorTcpConfiguration tcpConfiguration; + + /* + * The parameters used to perform test evaluation over ICMP. + */ + @JsonProperty(value = "icmpConfiguration") + private ConnectionMonitorIcmpConfiguration icmpConfiguration; + + /* + * The threshold for declaring a test successful. + */ + @JsonProperty(value = "successThreshold") + private ConnectionMonitorSuccessThreshold successThreshold; + + /** + * Get the name property: The name of the connection monitor test configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor test configuration. + * + * @param name the name value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the testFrequencySec property: The frequency of test evaluation, in seconds. + * + * @return the testFrequencySec value. + */ + public Integer testFrequencySec() { + return this.testFrequencySec; + } + + /** + * Set the testFrequencySec property: The frequency of test evaluation, in seconds. + * + * @param testFrequencySec the testFrequencySec value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withTestFrequencySec(Integer testFrequencySec) { + this.testFrequencySec = testFrequencySec; + return this; + } + + /** + * Get the protocol property: The protocol to use in test evaluation. + * + * @return the protocol value. + */ + public ConnectionMonitorTestConfigurationProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol to use in test evaluation. + * + * @param protocol the protocol value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withProtocol(ConnectionMonitorTestConfigurationProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the preferredIpVersion property: The preferred IP version to use in test evaluation. The connection monitor + * may choose to use a different version depending on other parameters. + * + * @return the preferredIpVersion value. + */ + public PreferredIpVersion preferredIpVersion() { + return this.preferredIpVersion; + } + + /** + * Set the preferredIpVersion property: The preferred IP version to use in test evaluation. The connection monitor + * may choose to use a different version depending on other parameters. + * + * @param preferredIpVersion the preferredIpVersion value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withPreferredIpVersion(PreferredIpVersion preferredIpVersion) { + this.preferredIpVersion = preferredIpVersion; + return this; + } + + /** + * Get the httpConfiguration property: The parameters used to perform test evaluation over HTTP. + * + * @return the httpConfiguration value. + */ + public ConnectionMonitorHttpConfiguration httpConfiguration() { + return this.httpConfiguration; + } + + /** + * Set the httpConfiguration property: The parameters used to perform test evaluation over HTTP. + * + * @param httpConfiguration the httpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withHttpConfiguration( + ConnectionMonitorHttpConfiguration httpConfiguration) { + this.httpConfiguration = httpConfiguration; + return this; + } + + /** + * Get the tcpConfiguration property: The parameters used to perform test evaluation over TCP. + * + * @return the tcpConfiguration value. + */ + public ConnectionMonitorTcpConfiguration tcpConfiguration() { + return this.tcpConfiguration; + } + + /** + * Set the tcpConfiguration property: The parameters used to perform test evaluation over TCP. + * + * @param tcpConfiguration the tcpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withTcpConfiguration(ConnectionMonitorTcpConfiguration tcpConfiguration) { + this.tcpConfiguration = tcpConfiguration; + return this; + } + + /** + * Get the icmpConfiguration property: The parameters used to perform test evaluation over ICMP. + * + * @return the icmpConfiguration value. + */ + public ConnectionMonitorIcmpConfiguration icmpConfiguration() { + return this.icmpConfiguration; + } + + /** + * Set the icmpConfiguration property: The parameters used to perform test evaluation over ICMP. + * + * @param icmpConfiguration the icmpConfiguration value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withIcmpConfiguration( + ConnectionMonitorIcmpConfiguration icmpConfiguration) { + this.icmpConfiguration = icmpConfiguration; + return this; + } + + /** + * Get the successThreshold property: The threshold for declaring a test successful. + * + * @return the successThreshold value. + */ + public ConnectionMonitorSuccessThreshold successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: The threshold for declaring a test successful. + * + * @param successThreshold the successThreshold value to set. + * @return the ConnectionMonitorTestConfiguration object itself. + */ + public ConnectionMonitorTestConfiguration withSuccessThreshold(ConnectionMonitorSuccessThreshold successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ConnectionMonitorTestConfiguration")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model ConnectionMonitorTestConfiguration")); + } + if (httpConfiguration() != null) { + httpConfiguration().validate(); + } + if (tcpConfiguration() != null) { + tcpConfiguration().validate(); + } + if (icmpConfiguration() != null) { + icmpConfiguration().validate(); + } + if (successThreshold() != null) { + successThreshold().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java new file mode 100644 index 0000000000000..fb42748df1278 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorTestConfigurationProtocol. */ +public final class ConnectionMonitorTestConfigurationProtocol + extends ExpandableStringEnum { + /** Static value Tcp for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol TCP = fromString("Tcp"); + + /** Static value Http for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol HTTP = fromString("Http"); + + /** Static value Icmp for ConnectionMonitorTestConfigurationProtocol. */ + public static final ConnectionMonitorTestConfigurationProtocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a ConnectionMonitorTestConfigurationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorTestConfigurationProtocol. + */ + @JsonCreator + public static ConnectionMonitorTestConfigurationProtocol fromString(String name) { + return fromString(name, ConnectionMonitorTestConfigurationProtocol.class); + } + + /** @return known ConnectionMonitorTestConfigurationProtocol values. */ + public static Collection values() { + return values(ConnectionMonitorTestConfigurationProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java new file mode 100644 index 0000000000000..cbfc533d7b9ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the connection monitor test group. */ +@Fluent +public final class ConnectionMonitorTestGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorTestGroup.class); + + /* + * The name of the connection monitor test group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Value indicating whether test group is disabled. + */ + @JsonProperty(value = "disable") + private Boolean disable; + + /* + * List of test configuration names. + */ + @JsonProperty(value = "testConfigurations", required = true) + private List testConfigurations; + + /* + * List of source endpoint names. + */ + @JsonProperty(value = "sources", required = true) + private List sources; + + /* + * List of destination endpoint names. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /** + * Get the name property: The name of the connection monitor test group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the connection monitor test group. + * + * @param name the name value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the disable property: Value indicating whether test group is disabled. + * + * @return the disable value. + */ + public Boolean disable() { + return this.disable; + } + + /** + * Set the disable property: Value indicating whether test group is disabled. + * + * @param disable the disable value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withDisable(Boolean disable) { + this.disable = disable; + return this; + } + + /** + * Get the testConfigurations property: List of test configuration names. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.testConfigurations; + } + + /** + * Set the testConfigurations property: List of test configuration names. + * + * @param testConfigurations the testConfigurations value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withTestConfigurations(List testConfigurations) { + this.testConfigurations = testConfigurations; + return this; + } + + /** + * Get the sources property: List of source endpoint names. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: List of source endpoint names. + * + * @param sources the sources value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the destinations property: List of destination endpoint names. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of destination endpoint names. + * + * @param destinations the destinations value to set. + * @return the ConnectionMonitorTestGroup object itself. + */ + public ConnectionMonitorTestGroup withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ConnectionMonitorTestGroup")); + } + if (testConfigurations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property testConfigurations in model ConnectionMonitorTestGroup")); + } + if (sources() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sources in model ConnectionMonitorTestGroup")); + } + if (destinations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinations in model ConnectionMonitorTestGroup")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java new file mode 100644 index 0000000000000..20055a5a25a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionMonitorType. */ +public final class ConnectionMonitorType extends ExpandableStringEnum { + /** Static value MultiEndpoint for ConnectionMonitorType. */ + public static final ConnectionMonitorType MULTI_ENDPOINT = fromString("MultiEndpoint"); + + /** Static value SingleSourceDestination for ConnectionMonitorType. */ + public static final ConnectionMonitorType SINGLE_SOURCE_DESTINATION = fromString("SingleSourceDestination"); + + /** + * Creates or finds a ConnectionMonitorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorType. + */ + @JsonCreator + public static ConnectionMonitorType fromString(String name) { + return fromString(name, ConnectionMonitorType.class); + } + + /** @return known ConnectionMonitorType values. */ + public static Collection values() { + return values(ConnectionMonitorType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java new file mode 100644 index 0000000000000..1387f63488f8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the settings for producing output into a log analytics workspace. */ +@Fluent +public final class ConnectionMonitorWorkspaceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionMonitorWorkspaceSettings.class); + + /* + * Log analytics workspace resource ID. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /** + * Get the workspaceResourceId property: Log analytics workspace resource ID. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: Log analytics workspace resource ID. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the ConnectionMonitorWorkspaceSettings object itself. + */ + public ConnectionMonitorWorkspaceSettings withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java new file mode 100644 index 0000000000000..39cbe896978ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ConnectionMonitors. */ +public interface ConnectionMonitors { + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name. + */ + ConnectionMonitorResult get(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Gets a connection monitor by name. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Deletes the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Stops the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Starts the specified connection monitor. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name of the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName); + + /** + * Query a snapshot of the most recent connection states. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param connectionMonitorName The name given to the connection monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection states snapshots. + */ + ConnectionMonitorQueryResult query( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all connection monitors for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of connection monitors. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); + + /** + * Gets a connection monitor by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a connection monitor by name 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..4d347a36260b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionState. */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Reachable for ConnectionState. */ + public static final ConnectionState REACHABLE = fromString("Reachable"); + + /** Static value Unreachable for ConnectionState. */ + public static final ConnectionState UNREACHABLE = fromString("Unreachable"); + + /** Static value Unknown for ConnectionState. */ + public static final ConnectionState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionState. + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** @return known ConnectionState values. */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java new file mode 100644 index 0000000000000..d8a3f3599849b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Connection state snapshot. */ +@Fluent +public final class ConnectionStateSnapshot { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionStateSnapshot.class); + + /* + * The connection state. + */ + @JsonProperty(value = "connectionState") + private ConnectionState connectionState; + + /* + * The start time of the connection snapshot. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the connection snapshot. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Connectivity analysis evaluation state. + */ + @JsonProperty(value = "evaluationState") + private EvaluationState evaluationState; + + /* + * Average latency in ms. + */ + @JsonProperty(value = "avgLatencyInMs") + private Long avgLatencyInMs; + + /* + * Minimum latency in ms. + */ + @JsonProperty(value = "minLatencyInMs") + private Long minLatencyInMs; + + /* + * Maximum latency in ms. + */ + @JsonProperty(value = "maxLatencyInMs") + private Long maxLatencyInMs; + + /* + * The number of sent probes. + */ + @JsonProperty(value = "probesSent") + private Long probesSent; + + /* + * The number of failed probes. + */ + @JsonProperty(value = "probesFailed") + private Long probesFailed; + + /* + * List of hops between the source and the destination. + */ + @JsonProperty(value = "hops", access = JsonProperty.Access.WRITE_ONLY) + private List hops; + + /** + * Get the connectionState property: The connection state. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Set the connectionState property: The connection state. + * + * @param connectionState the connectionState value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withConnectionState(ConnectionState connectionState) { + this.connectionState = connectionState; + return this; + } + + /** + * Get the startTime property: The start time of the connection snapshot. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the connection snapshot. + * + * @param startTime the startTime value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the connection snapshot. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the connection snapshot. + * + * @param endTime the endTime value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the evaluationState property: Connectivity analysis evaluation state. + * + * @return the evaluationState value. + */ + public EvaluationState evaluationState() { + return this.evaluationState; + } + + /** + * Set the evaluationState property: Connectivity analysis evaluation state. + * + * @param evaluationState the evaluationState value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withEvaluationState(EvaluationState evaluationState) { + this.evaluationState = evaluationState; + return this; + } + + /** + * Get the avgLatencyInMs property: Average latency in ms. + * + * @return the avgLatencyInMs value. + */ + public Long avgLatencyInMs() { + return this.avgLatencyInMs; + } + + /** + * Set the avgLatencyInMs property: Average latency in ms. + * + * @param avgLatencyInMs the avgLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withAvgLatencyInMs(Long avgLatencyInMs) { + this.avgLatencyInMs = avgLatencyInMs; + return this; + } + + /** + * Get the minLatencyInMs property: Minimum latency in ms. + * + * @return the minLatencyInMs value. + */ + public Long minLatencyInMs() { + return this.minLatencyInMs; + } + + /** + * Set the minLatencyInMs property: Minimum latency in ms. + * + * @param minLatencyInMs the minLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMinLatencyInMs(Long minLatencyInMs) { + this.minLatencyInMs = minLatencyInMs; + return this; + } + + /** + * Get the maxLatencyInMs property: Maximum latency in ms. + * + * @return the maxLatencyInMs value. + */ + public Long maxLatencyInMs() { + return this.maxLatencyInMs; + } + + /** + * Set the maxLatencyInMs property: Maximum latency in ms. + * + * @param maxLatencyInMs the maxLatencyInMs value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withMaxLatencyInMs(Long maxLatencyInMs) { + this.maxLatencyInMs = maxLatencyInMs; + return this; + } + + /** + * Get the probesSent property: The number of sent probes. + * + * @return the probesSent value. + */ + public Long probesSent() { + return this.probesSent; + } + + /** + * Set the probesSent property: The number of sent probes. + * + * @param probesSent the probesSent value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesSent(Long probesSent) { + this.probesSent = probesSent; + return this; + } + + /** + * Get the probesFailed property: The number of failed probes. + * + * @return the probesFailed value. + */ + public Long probesFailed() { + return this.probesFailed; + } + + /** + * Set the probesFailed property: The number of failed probes. + * + * @param probesFailed the probesFailed value to set. + * @return the ConnectionStateSnapshot object itself. + */ + public ConnectionStateSnapshot withProbesFailed(Long probesFailed) { + this.probesFailed = probesFailed; + return this; + } + + /** + * Get the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + public List hops() { + return this.hops; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hops() != null) { + hops().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java new file mode 100644 index 0000000000000..e3ceb912bcaa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Degraded for ConnectionStatus. */ + public static final ConnectionStatus DEGRADED = fromString("Degraded"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java new file mode 100644 index 0000000000000..bf4be0c4203c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define destination of connection. */ +@Fluent +public final class ConnectivityDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityDestination.class); + + /* + * The ID of the resource to which a connection attempt will be made. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The IP address or URI the resource to which a connection attempt will be + * made. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Port on which check connectivity will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource to which a connection attempt will be made. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource to which a connection attempt will be made. + * + * @param resourceId the resourceId value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address property: The IP address or URI the resource to which a connection attempt will be made. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The IP address or URI the resource to which a connection attempt will be made. + * + * @param address the address value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: Port on which check connectivity will be performed. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port on which check connectivity will be performed. + * + * @param port the port value to set. + * @return the ConnectivityDestination object itself. + */ + public ConnectivityDestination withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java new file mode 100644 index 0000000000000..abf75fc421e42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about a hop between the source and the destination. */ +@Immutable +public final class ConnectivityHop { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityHop.class); + + /* + * The type of the hop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The ID of the hop. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The IP address of the hop. + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * The ID of the resource corresponding to this hop. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * List of next hop identifiers. + */ + @JsonProperty(value = "nextHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List nextHopIds; + + /* + * List of previous hop identifiers. + */ + @JsonProperty(value = "previousHopIds", access = JsonProperty.Access.WRITE_ONLY) + private List previousHopIds; + + /* + * List of hop links. + */ + @JsonProperty(value = "links", access = JsonProperty.Access.WRITE_ONLY) + private List links; + + /* + * List of previous hop links. + */ + @JsonProperty(value = "previousLinks", access = JsonProperty.Access.WRITE_ONLY) + private List previousLinks; + + /* + * List of issues. + */ + @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) + private List issues; + + /** + * Get the type property: The type of the hop. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the id property: The ID of the hop. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the address property: The IP address of the hop. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Get the resourceId property: The ID of the resource corresponding to this hop. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the nextHopIds property: List of next hop identifiers. + * + * @return the nextHopIds value. + */ + public List nextHopIds() { + return this.nextHopIds; + } + + /** + * Get the previousHopIds property: List of previous hop identifiers. + * + * @return the previousHopIds value. + */ + public List previousHopIds() { + return this.previousHopIds; + } + + /** + * Get the links property: List of hop links. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Get the previousLinks property: List of previous hop links. + * + * @return the previousLinks value. + */ + public List previousLinks() { + return this.previousLinks; + } + + /** + * Get the issues property: List of issues. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (links() != null) { + links().forEach(e -> e.validate()); + } + if (previousLinks() != null) { + previousLinks().forEach(e -> e.validate()); + } + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java new file mode 100644 index 0000000000000..a171e7acede86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner; +import java.util.List; + +/** An immutable client-side representation of ConnectivityInformation. */ +public interface ConnectivityInformation { + /** + * Gets the hops property: List of hops between the source and the destination. + * + * @return the hops value. + */ + List hops(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + ConnectionStatus connectionStatus(); + + /** + * Gets the avgLatencyInMs property: Average latency in milliseconds. + * + * @return the avgLatencyInMs value. + */ + Integer avgLatencyInMs(); + + /** + * Gets the minLatencyInMs property: Minimum latency in milliseconds. + * + * @return the minLatencyInMs value. + */ + Integer minLatencyInMs(); + + /** + * Gets the maxLatencyInMs property: Maximum latency in milliseconds. + * + * @return the maxLatencyInMs value. + */ + Integer maxLatencyInMs(); + + /** + * Gets the probesSent property: Total number of probes sent. + * + * @return the probesSent value. + */ + Integer probesSent(); + + /** + * Gets the probesFailed property: Number of failed probes. + * + * @return the probesFailed value. + */ + Integer probesFailed(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectivityInformationInner object. + * + * @return the inner object. + */ + ConnectivityInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java new file mode 100644 index 0000000000000..aa616df6a4449 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about an issue encountered in the process of checking for connectivity. */ +@Immutable +public final class ConnectivityIssue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityIssue.class); + + /* + * The origin of the issue. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * The severity of the issue. + */ + @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + private Severity severity; + + /* + * The type of issue. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private IssueType type; + + /* + * Provides additional context on the issue. + */ + @JsonProperty(value = "context", access = JsonProperty.Access.WRITE_ONLY) + private List> context; + + /** + * Get the origin property: The origin of the issue. + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the severity property: The severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the type property: The type of issue. + * + * @return the type value. + */ + public IssueType type() { + return this.type; + } + + /** + * Get the context property: Provides additional context on the issue. + * + * @return the context value. + */ + public List> context() { + return this.context; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java new file mode 100644 index 0000000000000..f4271cbda6e36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that determine how the connectivity check will be performed. */ +@Fluent +public final class ConnectivityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityParameters.class); + + /* + * The source of the connection. + */ + @JsonProperty(value = "source", required = true) + private ConnectivitySource source; + + /* + * The destination of connection. + */ + @JsonProperty(value = "destination", required = true) + private ConnectivityDestination destination; + + /* + * Network protocol. + */ + @JsonProperty(value = "protocol") + private Protocol protocol; + + /* + * Configuration of the protocol. + */ + @JsonProperty(value = "protocolConfiguration") + private ProtocolConfiguration protocolConfiguration; + + /* + * Preferred IP version of the connection. + */ + @JsonProperty(value = "preferredIPVersion") + private IpVersion preferredIpVersion; + + /** + * Get the source property: The source of the connection. + * + * @return the source value. + */ + public ConnectivitySource source() { + return this.source; + } + + /** + * Set the source property: The source of the connection. + * + * @param source the source value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withSource(ConnectivitySource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: The destination of connection. + * + * @return the destination value. + */ + public ConnectivityDestination destination() { + return this.destination; + } + + /** + * Set the destination property: The destination of connection. + * + * @param destination the destination value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withDestination(ConnectivityDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the protocol property: Network protocol. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol. + * + * @param protocol the protocol value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolConfiguration property: Configuration of the protocol. + * + * @return the protocolConfiguration value. + */ + public ProtocolConfiguration protocolConfiguration() { + return this.protocolConfiguration; + } + + /** + * Set the protocolConfiguration property: Configuration of the protocol. + * + * @param protocolConfiguration the protocolConfiguration value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withProtocolConfiguration(ProtocolConfiguration protocolConfiguration) { + this.protocolConfiguration = protocolConfiguration; + return this; + } + + /** + * Get the preferredIpVersion property: Preferred IP version of the connection. + * + * @return the preferredIpVersion value. + */ + public IpVersion preferredIpVersion() { + return this.preferredIpVersion; + } + + /** + * Set the preferredIpVersion property: Preferred IP version of the connection. + * + * @param preferredIpVersion the preferredIpVersion value to set. + * @return the ConnectivityParameters object itself. + */ + public ConnectivityParameters withPreferredIpVersion(IpVersion preferredIpVersion) { + this.preferredIpVersion = preferredIpVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ConnectivityParameters")); + } else { + source().validate(); + } + if (destination() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model ConnectivityParameters")); + } else { + destination().validate(); + } + if (protocolConfiguration() != null) { + protocolConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java new file mode 100644 index 0000000000000..a558c44b345ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the source of the connection. */ +@Fluent +public final class ConnectivitySource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivitySource.class); + + /* + * The ID of the resource from which a connectivity check will be + * initiated. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The source port from which a connectivity check will be performed. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the resourceId property: The ID of the resource from which a connectivity check will be initiated. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource from which a connectivity check will be initiated. + * + * @param resourceId the resourceId value to set. + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the port property: The source port from which a connectivity check will be performed. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The source port from which a connectivity check will be performed. + * + * @param port the port value to set. + * @return the ConnectivitySource object itself. + */ + public ConnectivitySource withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model ConnectivitySource")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java new file mode 100644 index 0000000000000..e3a0c5129e8a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Reference to container resource in remote resource provider. */ +@Fluent +public final class Container extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Container.class); + + /** {@inheritDoc} */ + @Override + public Container withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.java new file mode 100644 index 0000000000000..e1e986e2d195b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfacePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface child resource. */ +@Fluent +public final class ContainerNetworkInterface extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterface.class); + + /* + * 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; + + /** + * 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..2ce52867146ce --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceConfigurationPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container network interface configuration child resource. */ +@Fluent +public final class ContainerNetworkInterfaceConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceConfiguration.class); + + /* + * 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; + + /** + * 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..a423ff7825849 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ip configuration for a container network interface. */ +@Fluent +public final class ContainerNetworkInterfaceIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerNetworkInterfaceIpConfiguration.class); + + /* + * 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; + + /** + * 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..5de999e76223b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CoverageLevel. */ +public final class CoverageLevel extends ExpandableStringEnum { + /** Static value Default for CoverageLevel. */ + public static final CoverageLevel DEFAULT = fromString("Default"); + + /** Static value Low for CoverageLevel. */ + public static final CoverageLevel LOW = fromString("Low"); + + /** Static value BelowAverage for CoverageLevel. */ + public static final CoverageLevel BELOW_AVERAGE = fromString("BelowAverage"); + + /** Static value Average for CoverageLevel. */ + public static final CoverageLevel AVERAGE = fromString("Average"); + + /** Static value AboveAverage for CoverageLevel. */ + public static final CoverageLevel ABOVE_AVERAGE = fromString("AboveAverage"); + + /** Static value Full for CoverageLevel. */ + public static final CoverageLevel FULL = fromString("Full"); + + /** + * Creates or finds a CoverageLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding CoverageLevel. + */ + @JsonCreator + public static CoverageLevel fromString(String name) { + return fromString(name, CoverageLevel.class); + } + + /** @return known CoverageLevel values. */ + public static Collection values() { + return values(CoverageLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java new file mode 100644 index 0000000000000..d916343af0c7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Contains custom Dns resolution configuration from customer. */ +@Fluent +public final class CustomDnsConfigPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDnsConfigPropertiesFormat.class); + + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * A list of private ip addresses of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** + * Get the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @param fqdn the fqdn value to set. + * @return the CustomDnsConfigPropertiesFormat object itself. + */ + public CustomDnsConfigPropertiesFormat withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the ipAddresses property: A list of private ip addresses of the private endpoint. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: A list of private ip addresses of the private endpoint. + * + * @param ipAddresses the ipAddresses value to set. + * @return the CustomDnsConfigPropertiesFormat object itself. + */ + public CustomDnsConfigPropertiesFormat withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java new file mode 100644 index 0000000000000..740ee845e59bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CustomIpPrefix. */ +public interface CustomIpPrefix { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the custom IP prefix. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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 inner com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner object. + * + * @return the inner object. + */ + CustomIpPrefixInner innerModel(); + + /** The entirety of the CustomIpPrefix definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The CustomIpPrefix definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomIpPrefix definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CustomIpPrefix definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the CustomIpPrefix definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the CustomIpPrefix definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithZones, + DefinitionStages.WithCidr, + DefinitionStages.WithSignedMessage, + DefinitionStages.WithAuthorizationMessage, + DefinitionStages.WithCustomIpPrefixParent, + DefinitionStages.WithCommissionedState { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomIpPrefix create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomIpPrefix create(Context context); + } + /** The stage of the CustomIpPrefix definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CustomIpPrefix definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the custom IP prefix.. + * + * @param extendedLocation The extended location of the custom IP prefix. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the CustomIpPrefix definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the CustomIpPrefix definition allowing to specify cidr. */ + interface WithCidr { + /** + * Specifies the cidr property: The prefix range in CIDR notation. Should include the start address and the + * prefix length.. + * + * @param cidr The prefix range in CIDR notation. Should include the start address and the prefix length. + * @return the next definition stage. + */ + WithCreate withCidr(String cidr); + } + /** The stage of the CustomIpPrefix definition allowing to specify signedMessage. */ + interface WithSignedMessage { + /** + * Specifies the signedMessage property: Signed message for WAN validation.. + * + * @param signedMessage Signed message for WAN validation. + * @return the next definition stage. + */ + WithCreate withSignedMessage(String signedMessage); + } + /** The stage of the CustomIpPrefix definition allowing to specify authorizationMessage. */ + interface WithAuthorizationMessage { + /** + * Specifies the authorizationMessage property: Authorization message for WAN validation.. + * + * @param authorizationMessage Authorization message for WAN validation. + * @return the next definition stage. + */ + WithCreate withAuthorizationMessage(String authorizationMessage); + } + /** The stage of the CustomIpPrefix definition allowing to specify customIpPrefixParent. */ + interface WithCustomIpPrefixParent { + /** + * Specifies the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix.. + * + * @param customIpPrefixParent The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * @return the next definition stage. + */ + WithCreate withCustomIpPrefixParent(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); + } + } + /** + * Begins update for the CustomIpPrefix resource. + * + * @return the stage of resource update. + */ + CustomIpPrefix.Update update(); + + /** The template for CustomIpPrefix update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CustomIpPrefix apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CustomIpPrefix apply(Context context); + } + /** The CustomIpPrefix update stages. */ + interface UpdateStages { + /** The stage of the CustomIpPrefix update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomIpPrefix refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomIpPrefix refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java new file mode 100644 index 0000000000000..972681b5e3de6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListCustomIpPrefixes API service call. */ +@Fluent +public final class CustomIpPrefixListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomIpPrefixListResult.class); + + /* + * A list of Custom IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Custom IP prefixes that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Custom IP prefixes that exists in a resource group. + * + * @param value the value value to set. + * @return the CustomIpPrefixListResult object itself. + */ + public CustomIpPrefixListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the CustomIpPrefixListResult object itself. + */ + public CustomIpPrefixListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java new file mode 100644 index 0000000000000..e4d31c48d13e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CustomIpPrefixes. */ +public interface CustomIpPrefixes { + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Deletes the specified custom IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the CustomIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String customIpPrefixName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group. + */ + CustomIpPrefix getByResourceGroup(String resourceGroupName, String customIpPrefixName); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param customIpPrefixName The name of the custom IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String customIpPrefixName, String expand, Context context); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the custom IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the custom IP prefixes in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all custom IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all custom IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified custom IP prefix in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified custom IP prefix in a specified resource group 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..024a44a519053 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DdosCustomPolicies. */ +public interface DdosCustomPolicies { + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Deletes the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy. + */ + DdosCustomPolicy getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param resourceGroupName The name of the resource group. + * @param ddosCustomPolicyName The name of the DDoS custom policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosCustomPolicyName, Context context); + + /** + * Gets information about the specified DDoS custom policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS custom policy 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..7f8f5bc3b5861 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DdosCustomPolicy. */ +public interface DdosCustomPolicy { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 publicIpAddresses property: The list of public IPs associated with the DDoS custom policy resource. This + * list is read-only. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * Gets the protocolCustomSettings property: The protocol-specific DDoS policy customization parameters. + * + * @return the protocolCustomSettings value. + */ + List protocolCustomSettings(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.DdosCustomPolicyInner object. + * + * @return the inner object. + */ + DdosCustomPolicyInner innerModel(); + + /** The entirety of the DdosCustomPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DdosCustomPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the DdosCustomPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DdosCustomPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DdosCustomPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DdosCustomPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProtocolCustomSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + DdosCustomPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DdosCustomPolicy create(Context context); + } + /** The stage of the DdosCustomPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DdosCustomPolicy definition allowing to specify protocolCustomSettings. */ + interface WithProtocolCustomSettings { + /** + * Specifies the protocolCustomSettings property: The protocol-specific DDoS policy customization + * parameters.. + * + * @param protocolCustomSettings The protocol-specific DDoS policy customization parameters. + * @return the next definition stage. + */ + WithCreate withProtocolCustomSettings(List protocolCustomSettings); + } + } + /** + * Begins update for the DdosCustomPolicy resource. + * + * @return the stage of resource update. + */ + DdosCustomPolicy.Update update(); + + /** The template for DdosCustomPolicy update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DdosCustomPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DdosCustomPolicy apply(Context context); + } + /** The DdosCustomPolicy update stages. */ + interface UpdateStages { + /** The stage of the DdosCustomPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DdosCustomPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DdosCustomPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java new file mode 100644 index 0000000000000..dc5ba57706efc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosCustomPolicyProtocol. */ +public final class DdosCustomPolicyProtocol extends ExpandableStringEnum { + /** Static value Tcp for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol TCP = fromString("Tcp"); + + /** Static value Udp for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol UDP = fromString("Udp"); + + /** Static value Syn for DdosCustomPolicyProtocol. */ + public static final DdosCustomPolicyProtocol SYN = fromString("Syn"); + + /** + * Creates or finds a DdosCustomPolicyProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosCustomPolicyProtocol. + */ + @JsonCreator + public static DdosCustomPolicyProtocol fromString(String name) { + return fromString(name, DdosCustomPolicyProtocol.class); + } + + /** @return known DdosCustomPolicyProtocol values. */ + public static Collection values() { + return values(DdosCustomPolicyProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java new file mode 100644 index 0000000000000..d44a2c216d722 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicyTriggerSensitivityOverride.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosCustomPolicyTriggerSensitivityOverride. */ +public final class DdosCustomPolicyTriggerSensitivityOverride + extends ExpandableStringEnum { + /** Static value Relaxed for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride RELAXED = fromString("Relaxed"); + + /** Static value Low for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride LOW = fromString("Low"); + + /** Static value Default for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride DEFAULT = fromString("Default"); + + /** Static value High for DdosCustomPolicyTriggerSensitivityOverride. */ + public static final DdosCustomPolicyTriggerSensitivityOverride HIGH = fromString("High"); + + /** + * Creates or finds a DdosCustomPolicyTriggerSensitivityOverride from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosCustomPolicyTriggerSensitivityOverride. + */ + @JsonCreator + public static DdosCustomPolicyTriggerSensitivityOverride fromString(String name) { + return fromString(name, DdosCustomPolicyTriggerSensitivityOverride.class); + } + + /** @return known DdosCustomPolicyTriggerSensitivityOverride values. */ + public static Collection values() { + return values(DdosCustomPolicyTriggerSensitivityOverride.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java new file mode 100644 index 0000000000000..0c90a203da0de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DdosProtectionPlan. */ +public interface DdosProtectionPlan { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the resourceGuid property: The resource GUID property of the DDoS protection plan resource. It uniquely + * identifies the resource, even if the user changes its name or migrate the resource across subscriptions or + * resource groups. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the DDoS protection plan resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the virtualNetworks property: The list of virtual networks associated with the DDoS protection plan + * resource. This list is read-only. + * + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner object. + * + * @return the inner object. + */ + DdosProtectionPlanInner innerModel(); + + /** The entirety of the DdosProtectionPlan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DdosProtectionPlan definition stages. */ + interface DefinitionStages { + /** The first stage of the DdosProtectionPlan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DdosProtectionPlan definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DdosProtectionPlan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DdosProtectionPlan definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + DdosProtectionPlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DdosProtectionPlan create(Context context); + } + /** The stage of the DdosProtectionPlan definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the DdosProtectionPlan resource. + * + * @return the stage of resource update. + */ + DdosProtectionPlan.Update update(); + + /** The template for DdosProtectionPlan update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DdosProtectionPlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DdosProtectionPlan apply(Context context); + } + /** The DdosProtectionPlan update stages. */ + interface UpdateStages { + /** The stage of the DdosProtectionPlan update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DdosProtectionPlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DdosProtectionPlan refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java new file mode 100644 index 0000000000000..cf0c7ee326c49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of DDoS protection plans. */ +@Fluent +public final class DdosProtectionPlanListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosProtectionPlanListResult.class); + + /* + * A list of DDoS protection plans. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of DDoS protection plans. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of DDoS protection plans. + * + * @param value the value value to set. + * @return the DdosProtectionPlanListResult object itself. + */ + public DdosProtectionPlanListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java new file mode 100644 index 0000000000000..391992f08e373 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DdosProtectionPlans. */ +public interface DdosProtectionPlans { + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Deletes the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan. + */ + DdosProtectionPlan getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param resourceGroupName The name of the resource group. + * @param ddosProtectionPlanName The name of the DDoS protection plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ddosProtectionPlanName, Context context); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + PagedIterable list(); + + /** + * Gets all DDoS protection plans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all DDoS protection plans in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the DDoS protection plans in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the DDoS protection plans in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified DDoS protection plan. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified DDoS protection plan 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..94d6bb30ffff5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the DDoS protection settings of the public IP. */ +@Fluent +public final class DdosSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DdosSettings.class); + + /* + * The DDoS custom policy associated with the public IP. + */ + @JsonProperty(value = "ddosCustomPolicy") + private SubResource ddosCustomPolicy; + + /* + * The DDoS protection policy customizability of the public IP. Only + * standard coverage will have the ability to be customized. + */ + @JsonProperty(value = "protectionCoverage") + private DdosSettingsProtectionCoverage protectionCoverage; + + /* + * Enables DDoS protection on the public IP. + */ + @JsonProperty(value = "protectedIP") + private Boolean protectedIp; + + /** + * Get the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. + * + * @return the ddosCustomPolicy value. + */ + public SubResource ddosCustomPolicy() { + return this.ddosCustomPolicy; + } + + /** + * Set the ddosCustomPolicy property: The DDoS custom policy associated with the public IP. + * + * @param ddosCustomPolicy the ddosCustomPolicy value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withDdosCustomPolicy(SubResource ddosCustomPolicy) { + this.ddosCustomPolicy = ddosCustomPolicy; + return this; + } + + /** + * Get the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard + * coverage will have the ability to be customized. + * + * @return the protectionCoverage value. + */ + public DdosSettingsProtectionCoverage protectionCoverage() { + return this.protectionCoverage; + } + + /** + * Set the protectionCoverage property: The DDoS protection policy customizability of the public IP. Only standard + * coverage will have the ability to be customized. + * + * @param protectionCoverage the protectionCoverage value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectionCoverage(DdosSettingsProtectionCoverage protectionCoverage) { + this.protectionCoverage = protectionCoverage; + return this; + } + + /** + * Get the protectedIp property: Enables DDoS protection on the public IP. + * + * @return the protectedIp value. + */ + public Boolean protectedIp() { + return this.protectedIp; + } + + /** + * Set the protectedIp property: Enables DDoS protection on the public IP. + * + * @param protectedIp the protectedIp value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectedIp(Boolean protectedIp) { + this.protectedIp = protectedIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java new file mode 100644 index 0000000000000..cbebb705ecba8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionCoverage.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DdosSettingsProtectionCoverage. */ +public final class DdosSettingsProtectionCoverage extends ExpandableStringEnum { + /** Static value Basic for DdosSettingsProtectionCoverage. */ + public static final DdosSettingsProtectionCoverage BASIC = fromString("Basic"); + + /** Static value Standard for DdosSettingsProtectionCoverage. */ + public static final DdosSettingsProtectionCoverage STANDARD = fromString("Standard"); + + /** + * Creates or finds a DdosSettingsProtectionCoverage from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosSettingsProtectionCoverage. + */ + @JsonCreator + public static DdosSettingsProtectionCoverage fromString(String name) { + return fromString(name, DdosSettingsProtectionCoverage.class); + } + + /** @return known DdosSettingsProtectionCoverage values. */ + public static Collection values() { + return values(DdosSettingsProtectionCoverage.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java new file mode 100644 index 0000000000000..779c14a384c6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DefaultSecurityRules. */ +public interface DefaultSecurityRules { + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all default security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all default security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule. + */ + SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName); + + /** + * Get the specified default network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param defaultSecurityRuleName The name of the default security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified default network security rule along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String defaultSecurityRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.java new file mode 100644 index 0000000000000..700c27d0ac1cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceDelegationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details the service to which the subnet is delegated. */ +@Fluent +public final class Delegation extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Delegation.class); + + /* + * 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; + + /** + * 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/DeleteOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java new file mode 100644 index 0000000000000..02069df654c73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeleteOptions. */ +public final class DeleteOptions extends ExpandableStringEnum { + /** Static value Delete for DeleteOptions. */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** Static value Detach for DeleteOptions. */ + public static final DeleteOptions DETACH = fromString("Detach"); + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + @JsonCreator + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** @return known DeleteOptions values. */ + public static Collection values() { + return values(DeleteOptions.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java new file mode 100644 index 0000000000000..92b7e1e5cc1d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DestinationPortBehavior. */ +public final class DestinationPortBehavior extends ExpandableStringEnum { + /** Static value None for DestinationPortBehavior. */ + public static final DestinationPortBehavior NONE = fromString("None"); + + /** Static value ListenIfAvailable for DestinationPortBehavior. */ + public static final DestinationPortBehavior LISTEN_IF_AVAILABLE = fromString("ListenIfAvailable"); + + /** + * Creates or finds a DestinationPortBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationPortBehavior. + */ + @JsonCreator + public static DestinationPortBehavior fromString(String name) { + return fromString(name, DestinationPortBehavior.class); + } + + /** @return known DestinationPortBehavior values. */ + public static Collection values() { + return values(DestinationPortBehavior.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java new file mode 100644 index 0000000000000..ee486433f3918 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of properties of the device. */ +@Fluent +public final class DeviceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeviceProperties.class); + + /* + * Name of the device Vendor. + */ + @JsonProperty(value = "deviceVendor") + private String deviceVendor; + + /* + * Model of the device. + */ + @JsonProperty(value = "deviceModel") + private String deviceModel; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get the deviceVendor property: Name of the device Vendor. + * + * @return the deviceVendor value. + */ + public String deviceVendor() { + return this.deviceVendor; + } + + /** + * Set the deviceVendor property: Name of the device Vendor. + * + * @param deviceVendor the deviceVendor value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceVendor(String deviceVendor) { + this.deviceVendor = deviceVendor; + return this; + } + + /** + * Get the deviceModel property: Model of the device. + * + * @return the deviceModel value. + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Set the deviceModel property: Model of the device. + * + * @param deviceModel the deviceModel value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + return this; + } + + /** + * Get the linkSpeedInMbps property: Link speed. + * + * @return the linkSpeedInMbps value. + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set the linkSpeedInMbps property: Link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set. + * @return the DeviceProperties object itself. + */ + public DeviceProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java new file mode 100644 index 0000000000000..3d614a3ac6f14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DhGroup. */ +public final class DhGroup extends ExpandableStringEnum { + /** Static value None for DhGroup. */ + public static final DhGroup NONE = fromString("None"); + + /** Static value DHGroup1 for DhGroup. */ + public static final DhGroup DHGROUP1 = fromString("DHGroup1"); + + /** Static value DHGroup2 for DhGroup. */ + public static final DhGroup DHGROUP2 = fromString("DHGroup2"); + + /** Static value DHGroup14 for DhGroup. */ + public static final DhGroup DHGROUP14 = fromString("DHGroup14"); + + /** Static value DHGroup2048 for DhGroup. */ + public static final DhGroup DHGROUP2048 = fromString("DHGroup2048"); + + /** Static value ECP256 for DhGroup. */ + public static final DhGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for DhGroup. */ + public static final DhGroup ECP384 = fromString("ECP384"); + + /** Static value DHGroup24 for DhGroup. */ + public static final DhGroup DHGROUP24 = fromString("DHGroup24"); + + /** + * Creates or finds a DhGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding DhGroup. + */ + @JsonCreator + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** @return known DhGroup values. */ + public static Collection values() { + return values(DhGroup.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java new file mode 100644 index 0000000000000..136c68998e4b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option + * for a subnet overrides VNET DHCP options. + */ +@Fluent +public final class DhcpOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DhcpOptions.class); + + /* + * The list of DNS servers IP addresses. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Get the dnsServers property: The list of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: The list of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the DhcpOptions object itself. + */ + public DhcpOptions withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java new file mode 100644 index 0000000000000..21406b19b1927 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimension of the metric. */ +@Fluent +public final class Dimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); + + /* + * The name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The internal name of the dimension. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /** + * Get the name property: The name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the dimension. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: The internal name of the dimension. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: The internal name of the dimension. + * + * @param internalName the internalName value to set. + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java new file mode 100644 index 0000000000000..b05f63b1d107e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Direction. */ +public final class Direction extends ExpandableStringEnum { + /** Static value Inbound for Direction. */ + public static final Direction INBOUND = fromString("Inbound"); + + /** Static value Outbound for Direction. */ + public static final Direction OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Direction from its string representation. + * + * @param name a name to look for. + * @return the corresponding Direction. + */ + @JsonCreator + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** @return known Direction values. */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java new file mode 100644 index 0000000000000..f6bbf2df973c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner; + +/** An immutable client-side representation of DnsNameAvailabilityResult. */ +public interface DnsNameAvailabilityResult { + /** + * Gets the available property: Domain availability (True/False). + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.DnsNameAvailabilityResultInner object. + * + * @return the inner object. + */ + DnsNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java new file mode 100644 index 0000000000000..aa7964a6b2ed8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS Proxy Settings in Firewall Policy. */ +@Fluent +public final class DnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DnsSettings.class); + + /* + * List of Custom DNS Servers. + */ + @JsonProperty(value = "servers") + private List servers; + + /* + * Enable DNS Proxy on Firewalls attached to the Firewall Policy. + */ + @JsonProperty(value = "enableProxy") + private Boolean enableProxy; + + /* + * FQDNs in Network Rules are supported when set to true. + */ + @JsonProperty(value = "requireProxyForNetworkRules") + private Boolean requireProxyForNetworkRules; + + /** + * Get the servers property: List of Custom DNS Servers. + * + * @return the servers value. + */ + public List servers() { + return this.servers; + } + + /** + * Set the servers property: List of Custom DNS Servers. + * + * @param servers the servers value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withServers(List servers) { + this.servers = servers; + return this; + } + + /** + * Get the enableProxy property: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + * + * @return the enableProxy value. + */ + public Boolean enableProxy() { + return this.enableProxy; + } + + /** + * Set the enableProxy property: Enable DNS Proxy on Firewalls attached to the Firewall Policy. + * + * @param enableProxy the enableProxy value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withEnableProxy(Boolean enableProxy) { + this.enableProxy = enableProxy; + return this; + } + + /** + * Get the requireProxyForNetworkRules property: FQDNs in Network Rules are supported when set to true. + * + * @return the requireProxyForNetworkRules value. + */ + public Boolean requireProxyForNetworkRules() { + return this.requireProxyForNetworkRules; + } + + /** + * Set the requireProxyForNetworkRules property: FQDNs in Network Rules are supported when set to true. + * + * @param requireProxyForNetworkRules the requireProxyForNetworkRules value to set. + * @return the DnsSettings object itself. + */ + public DnsSettings withRequireProxyForNetworkRules(Boolean requireProxyForNetworkRules) { + this.requireProxyForNetworkRules = requireProxyForNetworkRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java new file mode 100644 index 0000000000000..321cb9910d6c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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 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..4eec5dddb8b90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the DscpConfigurationList API service call. */ +@Fluent +public final class DscpConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DscpConfigurationListResult.class); + + /* + * A list of dscp configurations in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of dscp configurations in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of dscp configurations in a resource group. + * + * @param value the value value to set. + * @return the DscpConfigurationListResult object itself. + */ + public DscpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java new file mode 100644 index 0000000000000..88e1837dd596a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DscpConfigurations. */ +public interface DscpConfigurations { + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Deletes a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + DscpConfiguration getByResourceGroup(String resourceGroupName, String dscpConfigurationName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param dscpConfigurationName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String dscpConfigurationName, Context context); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a DSCP Configuration. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all dscp configurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + PagedIterable list(); + + /** + * Gets all dscp configurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all dscp configurations in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets a DSCP Configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DSCP Configuration 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/EffectiveNetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java new file mode 100644 index 0000000000000..818bbdc006cc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective network security group. */ +@Fluent +public final class EffectiveNetworkSecurityGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroup.class); + + /* + * The ID of network security group that is applied. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * Associated resources. + */ + @JsonProperty(value = "association") + private EffectiveNetworkSecurityGroupAssociation association; + + /* + * A collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /* + * Mapping of tags to list of IP Addresses included within the tag. + */ + @JsonProperty(value = "tagMap") + private String tagMap; + + /** + * Get the networkSecurityGroup property: The ID of network security group that is applied. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The ID of network security group that is applied. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the association property: Associated resources. + * + * @return the association value. + */ + public EffectiveNetworkSecurityGroupAssociation association() { + return this.association; + } + + /** + * Set the association property: Associated resources. + * + * @param association the association value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withAssociation(EffectiveNetworkSecurityGroupAssociation association) { + this.association = association; + return this; + } + + /** + * Get the effectiveSecurityRules property: A collection of effective security rules. + * + * @return the effectiveSecurityRules value. + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set the effectiveSecurityRules property: A collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withEffectiveSecurityRules( + List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Get the tagMap property: Mapping of tags to list of IP Addresses included within the tag. + * + * @return the tagMap value. + */ + public String tagMap() { + return this.tagMap; + } + + /** + * Set the tagMap property: Mapping of tags to list of IP Addresses included within the tag. + * + * @param tagMap the tagMap value to set. + * @return the EffectiveNetworkSecurityGroup object itself. + */ + public EffectiveNetworkSecurityGroup withTagMap(String tagMap) { + this.tagMap = tagMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (association() != null) { + association().validate(); + } + if (effectiveSecurityRules() != null) { + effectiveSecurityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java new file mode 100644 index 0000000000000..6b08191ffce03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The effective network security group association. */ +@Fluent +public final class EffectiveNetworkSecurityGroupAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityGroupAssociation.class); + + /* + * The ID of the Azure network manager if assigned. + */ + @JsonProperty(value = "networkManager") + private SubResource networkManager; + + /* + * The ID of the subnet if assigned. + */ + @JsonProperty(value = "subnet") + private SubResource subnet; + + /* + * The ID of the network interface if assigned. + */ + @JsonProperty(value = "networkInterface") + private SubResource networkInterface; + + /** + * Get the networkManager property: The ID of the Azure network manager if assigned. + * + * @return the networkManager value. + */ + public SubResource networkManager() { + return this.networkManager; + } + + /** + * Set the networkManager property: The ID of the Azure network manager if assigned. + * + * @param networkManager the networkManager value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkManager(SubResource networkManager) { + this.networkManager = networkManager; + return this; + } + + /** + * Get the subnet property: The ID of the subnet if assigned. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The ID of the subnet if assigned. + * + * @param subnet the subnet value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withSubnet(SubResource subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the networkInterface property: The ID of the network interface if assigned. + * + * @return the networkInterface value. + */ + public SubResource networkInterface() { + return this.networkInterface; + } + + /** + * Set the networkInterface property: The ID of the network interface if assigned. + * + * @param networkInterface the networkInterface value to set. + * @return the EffectiveNetworkSecurityGroupAssociation object itself. + */ + public EffectiveNetworkSecurityGroupAssociation withNetworkInterface(SubResource networkInterface) { + this.networkInterface = networkInterface; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..d11a4d350adf0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveNetworkSecurityGroupListResult. */ +public interface EffectiveNetworkSecurityGroupListResult { + /** + * Gets the value property: A list of effective network security groups. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.EffectiveNetworkSecurityGroupListResultInner object. + * + * @return the inner object. + */ + EffectiveNetworkSecurityGroupListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java new file mode 100644 index 0000000000000..ddf7a8bce67fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective network security rules. */ +@Fluent +public final class EffectiveNetworkSecurityRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveNetworkSecurityRule.class); + + /* + * The name of the security rule specified by the user (if created by the + * user). + */ + @JsonProperty(value = "name") + private String name; + + /* + * The network protocol this rule applies to. + */ + @JsonProperty(value = "protocol") + private EffectiveSecurityRuleProtocol protocol; + + /* + * The source port or range. + */ + @JsonProperty(value = "sourcePortRange") + private String sourcePortRange; + + /* + * The destination port or range. + */ + @JsonProperty(value = "destinationPortRange") + private String destinationPortRange; + + /* + * The source port ranges. Expected values include a single integer between + * 0 and 65535, a range using '-' as separator (e.g. 100-400), or an + * asterisk (*). + */ + @JsonProperty(value = "sourcePortRanges") + private List sourcePortRanges; + + /* + * The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or + * an asterisk (*). + */ + @JsonProperty(value = "destinationPortRanges") + private List destinationPortRanges; + + /* + * The source address prefix. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * The destination address prefix. + */ + @JsonProperty(value = "destinationAddressPrefix") + private String destinationAddressPrefix; + + /* + * The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, + * and the asterisk (*). + */ + @JsonProperty(value = "sourceAddressPrefixes") + private List sourceAddressPrefixes; + + /* + * The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), + * System Tags, and the asterisk (*). + */ + @JsonProperty(value = "destinationAddressPrefixes") + private List destinationAddressPrefixes; + + /* + * The expanded source address prefix. + */ + @JsonProperty(value = "expandedSourceAddressPrefix") + private List expandedSourceAddressPrefix; + + /* + * Expanded destination address prefix. + */ + @JsonProperty(value = "expandedDestinationAddressPrefix") + private List expandedDestinationAddressPrefix; + + /* + * Whether network traffic is allowed or denied. + */ + @JsonProperty(value = "access") + private SecurityRuleAccess access; + + /* + * The priority of the rule. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /* + * The direction of the rule. + */ + @JsonProperty(value = "direction") + private SecurityRuleDirection direction; + + /** + * Get the name property: The name of the security rule specified by the user (if created by the user). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the security rule specified by the user (if created by the user). + * + * @param name the name value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol property: The network protocol this rule applies to. + * + * @return the protocol value. + */ + public EffectiveSecurityRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withProtocol(EffectiveSecurityRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourcePortRange property: The source port or range. + * + * @return the sourcePortRange value. + */ + public String sourcePortRange() { + return this.sourcePortRange; + } + + /** + * Set the sourcePortRange property: The source port or range. + * + * @param sourcePortRange the sourcePortRange value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRange(String sourcePortRange) { + this.sourcePortRange = sourcePortRange; + return this; + } + + /** + * Get the destinationPortRange property: The destination port or range. + * + * @return the destinationPortRange value. + */ + public String destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: The destination port or range. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRange(String destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and + * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Set the sourcePortRanges property: The source port ranges. Expected values include a single integer between 0 and + * 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourcePortRanges(List sourcePortRanges) { + this.sourcePortRanges = sourcePortRanges; + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destinationPortRanges property: The destination port ranges. Expected values include a single integer + * between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the sourceAddressPrefix property: The source address prefix. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The source address prefix. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destinationAddressPrefix property: The destination address prefix. + * + * @return the destinationAddressPrefix value. + */ + public String destinationAddressPrefix() { + return this.destinationAddressPrefix; + } + + /** + * Set the destinationAddressPrefix property: The destination address prefix. + * + * @param destinationAddressPrefix the destinationAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix) { + this.destinationAddressPrefix = destinationAddressPrefix; + return this; + } + + /** + * Get the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @return the sourceAddressPrefixes value. + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the sourceAddressPrefixes property: The source address prefixes. Expected values include CIDR IP ranges, + * Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @return the destinationAddressPrefixes value. + */ + public List destinationAddressPrefixes() { + return this.destinationAddressPrefixes; + } + + /** + * Set the destinationAddressPrefixes property: The destination address prefixes. Expected values include CIDR IP + * ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + * + * @param destinationAddressPrefixes the destinationAddressPrefixes value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDestinationAddressPrefixes(List destinationAddressPrefixes) { + this.destinationAddressPrefixes = destinationAddressPrefixes; + return this; + } + + /** + * Get the expandedSourceAddressPrefix property: The expanded source address prefix. + * + * @return the expandedSourceAddressPrefix value. + */ + public List expandedSourceAddressPrefix() { + return this.expandedSourceAddressPrefix; + } + + /** + * Set the expandedSourceAddressPrefix property: The expanded source address prefix. + * + * @param expandedSourceAddressPrefix the expandedSourceAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedSourceAddressPrefix(List expandedSourceAddressPrefix) { + this.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + return this; + } + + /** + * Get the expandedDestinationAddressPrefix property: Expanded destination address prefix. + * + * @return the expandedDestinationAddressPrefix value. + */ + public List expandedDestinationAddressPrefix() { + return this.expandedDestinationAddressPrefix; + } + + /** + * Set the expandedDestinationAddressPrefix property: Expanded destination address prefix. + * + * @param expandedDestinationAddressPrefix the expandedDestinationAddressPrefix value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withExpandedDestinationAddressPrefix( + List expandedDestinationAddressPrefix) { + this.expandedDestinationAddressPrefix = expandedDestinationAddressPrefix; + return this; + } + + /** + * Get the access property: Whether network traffic is allowed or denied. + * + * @return the access value. + */ + public SecurityRuleAccess access() { + return this.access; + } + + /** + * Set the access property: Whether network traffic is allowed or denied. + * + * @param access the access value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withAccess(SecurityRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority property: The priority of the rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. + * + * @param priority the priority value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction property: The direction of the rule. + * + * @return the direction value. + */ + public SecurityRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the rule. + * + * @param direction the direction value to set. + * @return the EffectiveNetworkSecurityRule object itself. + */ + public EffectiveNetworkSecurityRule withDirection(SecurityRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java new file mode 100644 index 0000000000000..1eea2556326f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Effective Route. */ +@Fluent +public final class EffectiveRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRoute.class); + + /* + * The name of the user defined route. This is optional. + */ + @JsonProperty(value = "name") + private String name; + + /* + * If true, on-premises routes are not propagated to the network interfaces + * in the subnet. + */ + @JsonProperty(value = "disableBgpRoutePropagation") + private Boolean disableBgpRoutePropagation; + + /* + * Who created the route. + */ + @JsonProperty(value = "source") + private EffectiveRouteSource source; + + /* + * The value of effective route. + */ + @JsonProperty(value = "state") + private EffectiveRouteState state; + + /* + * The address prefixes of the effective routes in CIDR notation. + */ + @JsonProperty(value = "addressPrefix") + private List addressPrefix; + + /* + * The IP address of the next hop of the effective route. + */ + @JsonProperty(value = "nextHopIpAddress") + private List nextHopIpAddress; + + /* + * The type of Azure hop the packet should be sent to. + */ + @JsonProperty(value = "nextHopType") + private RouteNextHopType nextHopType; + + /** + * Get the name property: The name of the user defined route. This is optional. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the user defined route. This is optional. + * + * @param name the name value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the disableBgpRoutePropagation property: If true, on-premises routes are not propagated to the network + * interfaces in the subnet. + * + * @return the disableBgpRoutePropagation value. + */ + public Boolean disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set the disableBgpRoutePropagation property: If true, on-premises routes are not propagated to the network + * interfaces in the subnet. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Get the source property: Who created the route. + * + * @return the source value. + */ + public EffectiveRouteSource source() { + return this.source; + } + + /** + * Set the source property: Who created the route. + * + * @param source the source value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withSource(EffectiveRouteSource source) { + this.source = source; + return this; + } + + /** + * Get the state property: The value of effective route. + * + * @return the state value. + */ + public EffectiveRouteState state() { + return this.state; + } + + /** + * Set the state property: The value of effective route. + * + * @param state the state value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withState(EffectiveRouteState state) { + this.state = state; + return this; + } + + /** + * Get the addressPrefix property: The address prefixes of the effective routes in CIDR notation. + * + * @return the addressPrefix value. + */ + public List addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: The address prefixes of the effective routes in CIDR notation. + * + * @param addressPrefix the addressPrefix value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withAddressPrefix(List addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the nextHopIpAddress property: The IP address of the next hop of the effective route. + * + * @return the nextHopIpAddress value. + */ + public List nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: The IP address of the next hop of the effective route. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopIpAddress(List nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Get the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @return the nextHopType value. + */ + public RouteNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @param nextHopType the nextHopType value to set. + * @return the EffectiveRoute object itself. + */ + public EffectiveRoute withNextHopType(RouteNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java new file mode 100644 index 0000000000000..c956b9188cc9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of EffectiveRouteListResult. */ +public interface EffectiveRouteListResult { + /** + * Gets the value property: A list of effective routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteListResultInner object. + * + * @return the inner object. + */ + EffectiveRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java new file mode 100644 index 0000000000000..244b2c0f1ac99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveRouteSource. */ +public final class EffectiveRouteSource extends ExpandableStringEnum { + /** Static value Unknown for EffectiveRouteSource. */ + public static final EffectiveRouteSource UNKNOWN = fromString("Unknown"); + + /** Static value User for EffectiveRouteSource. */ + public static final EffectiveRouteSource USER = fromString("User"); + + /** Static value VirtualNetworkGateway for EffectiveRouteSource. */ + public static final EffectiveRouteSource VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value Default for EffectiveRouteSource. */ + public static final EffectiveRouteSource DEFAULT = fromString("Default"); + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteSource. + */ + @JsonCreator + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** @return known EffectiveRouteSource values. */ + public static Collection values() { + return values(EffectiveRouteSource.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java new file mode 100644 index 0000000000000..f547803ed4ac2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveRouteState. */ +public final class EffectiveRouteState extends ExpandableStringEnum { + /** Static value Active for EffectiveRouteState. */ + public static final EffectiveRouteState ACTIVE = fromString("Active"); + + /** Static value Invalid for EffectiveRouteState. */ + public static final EffectiveRouteState INVALID = fromString("Invalid"); + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteState. + */ + @JsonCreator + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** @return known EffectiveRouteState values. */ + public static Collection values() { + return values(EffectiveRouteState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java new file mode 100644 index 0000000000000..2caa69797fdcb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters specifying the resource whose effective routes are being requested. */ +@Fluent +public final class EffectiveRoutesParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EffectiveRoutesParameters.class); + + /* + * The resource whose effective routes are being requested. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and + * P2SConnection. + */ + @JsonProperty(value = "virtualWanResourceType") + private String virtualWanResourceType; + + /** + * Get the resourceId property: The resource whose effective routes are being requested. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource whose effective routes are being requested. + * + * @param resourceId the resourceId value to set. + * @return the EffectiveRoutesParameters object itself. + */ + public EffectiveRoutesParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the virtualWanResourceType property: The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @return the virtualWanResourceType value. + */ + public String virtualWanResourceType() { + return this.virtualWanResourceType; + } + + /** + * Set the virtualWanResourceType property: The type of the specified resource like RouteTable, + * ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @param virtualWanResourceType the virtualWanResourceType value to set. + * @return the EffectiveRoutesParameters object itself. + */ + public EffectiveRoutesParameters withVirtualWanResourceType(String virtualWanResourceType) { + this.virtualWanResourceType = virtualWanResourceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java new file mode 100644 index 0000000000000..663844cb82ee4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EffectiveSecurityRuleProtocol. */ +public final class EffectiveSecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value All for EffectiveSecurityRuleProtocol. */ + public static final EffectiveSecurityRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveSecurityRuleProtocol. + */ + @JsonCreator + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** @return known EffectiveSecurityRuleProtocol values. */ + public static Collection values() { + return values(EffectiveSecurityRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java new file mode 100644 index 0000000000000..917886e1f7f53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; + +/** An immutable client-side representation of EndpointServiceResult. */ +public interface EndpointServiceResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the endpoint service. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the endpoint service. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner object. + * + * @return the inner object. + */ + EndpointServiceResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java new file mode 100644 index 0000000000000..993fe02ca5a8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListAvailableEndpointServices API service call. */ +@Fluent +public final class EndpointServicesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointServicesListResult.class); + + /* + * List of available endpoint services in a region. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of available endpoint services in a region. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of available endpoint services in a region. + * + * @param value the value value to set. + * @return the EndpointServicesListResult object itself. + */ + public EndpointServicesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the EndpointServicesListResult object itself. + */ + public EndpointServicesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java new file mode 100644 index 0000000000000..b573e648e1170 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EndpointType. */ +public final class EndpointType extends ExpandableStringEnum { + /** Static value AzureVM for EndpointType. */ + public static final EndpointType AZURE_VM = fromString("AzureVM"); + + /** Static value AzureVNet for EndpointType. */ + public static final EndpointType AZURE_VNET = fromString("AzureVNet"); + + /** Static value AzureSubnet for EndpointType. */ + public static final EndpointType AZURE_SUBNET = fromString("AzureSubnet"); + + /** Static value ExternalAddress for EndpointType. */ + public static final EndpointType EXTERNAL_ADDRESS = fromString("ExternalAddress"); + + /** Static value MMAWorkspaceMachine for EndpointType. */ + public static final EndpointType MMAWORKSPACE_MACHINE = fromString("MMAWorkspaceMachine"); + + /** Static value MMAWorkspaceNetwork for EndpointType. */ + public static final EndpointType MMAWORKSPACE_NETWORK = fromString("MMAWorkspaceNetwork"); + + /** + * Creates or finds a EndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointType. + */ + @JsonCreator + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** @return known EndpointType values. */ + public static Collection values() { + return values(EndpointType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java new file mode 100644 index 0000000000000..2f2463d4433a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Common error representation. */ +@Immutable +public final class Error extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * Inner error message. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private String innerError; + + /** + * Get the innerError property: Inner error message. + * + * @return the innerError value. + */ + public String getInnerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java new file mode 100644 index 0000000000000..834682a50a79b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with Error information. */ +public final class ErrorException extends ManagementException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ErrorException(String message, HttpResponse response, Error value) { + super(message, response, value); + } + + @Override + public Error getValue() { + return (Error) super.getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java new file mode 100644 index 0000000000000..30e28f32a5c74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Results of network security group evaluation. */ +@Fluent +public final class EvaluatedNetworkSecurityGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EvaluatedNetworkSecurityGroup.class); + + /* + * Network security group ID. + */ + @JsonProperty(value = "networkSecurityGroupId") + private String networkSecurityGroupId; + + /* + * Resource ID of nic or subnet to which network security group is applied. + */ + @JsonProperty(value = "appliedTo") + private String appliedTo; + + /* + * Matched network security rule. + */ + @JsonProperty(value = "matchedRule") + private MatchedRule matchedRule; + + /* + * List of network security rules evaluation results. + */ + @JsonProperty(value = "rulesEvaluationResult", access = JsonProperty.Access.WRITE_ONLY) + private List rulesEvaluationResult; + + /** + * Get the networkSecurityGroupId property: Network security group ID. + * + * @return the networkSecurityGroupId value. + */ + public String networkSecurityGroupId() { + return this.networkSecurityGroupId; + } + + /** + * Set the networkSecurityGroupId property: Network security group ID. + * + * @param networkSecurityGroupId the networkSecurityGroupId value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withNetworkSecurityGroupId(String networkSecurityGroupId) { + this.networkSecurityGroupId = networkSecurityGroupId; + return this; + } + + /** + * Get the appliedTo property: Resource ID of nic or subnet to which network security group is applied. + * + * @return the appliedTo value. + */ + public String appliedTo() { + return this.appliedTo; + } + + /** + * Set the appliedTo property: Resource ID of nic or subnet to which network security group is applied. + * + * @param appliedTo the appliedTo value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withAppliedTo(String appliedTo) { + this.appliedTo = appliedTo; + return this; + } + + /** + * Get the matchedRule property: Matched network security rule. + * + * @return the matchedRule value. + */ + public MatchedRule matchedRule() { + return this.matchedRule; + } + + /** + * Set the matchedRule property: Matched network security rule. + * + * @param matchedRule the matchedRule value to set. + * @return the EvaluatedNetworkSecurityGroup object itself. + */ + public EvaluatedNetworkSecurityGroup withMatchedRule(MatchedRule matchedRule) { + this.matchedRule = matchedRule; + return this; + } + + /** + * Get the rulesEvaluationResult property: List of network security rules evaluation results. + * + * @return the rulesEvaluationResult value. + */ + public List rulesEvaluationResult() { + return this.rulesEvaluationResult; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchedRule() != null) { + matchedRule().validate(); + } + if (rulesEvaluationResult() != null) { + rulesEvaluationResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java new file mode 100644 index 0000000000000..cbf2062946914 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EvaluationState. */ +public final class EvaluationState extends ExpandableStringEnum { + /** Static value NotStarted for EvaluationState. */ + public static final EvaluationState NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for EvaluationState. */ + public static final EvaluationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for EvaluationState. */ + public static final EvaluationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a EvaluationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluationState. + */ + @JsonCreator + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** @return known EvaluationState values. */ + public static Collection values() { + return values(EvaluationState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..e653e86954807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule to use for exclusion. */ +@Fluent +public final class ExclusionManagedRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExclusionManagedRule.class); + + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /** + * 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")); + } + } +} 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..30398878b395d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group to use for exclusion. */ +@Fluent +public final class ExclusionManagedRuleGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExclusionManagedRuleGroup.class); + + /* + * 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; + + /** + * 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()); + } + } +} 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..d703223f59af1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set for Exclusions. */ +@Fluent +public final class ExclusionManagedRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExclusionManagedRuleSet.class); + + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the rule groups to apply to the rule set. + */ + @JsonProperty(value = "ruleGroups") + private List ruleGroups; + + /** + * 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()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxySettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxySettings.java new file mode 100644 index 0000000000000..0341c9875cf8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxySettings.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Explicit Proxy Settings in Firewall Policy. */ +@Fluent +public final class ExplicitProxySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExplicitProxySettings.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 ExplicitProxySettings object itself. + */ + public ExplicitProxySettings 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 ExplicitProxySettings object itself. + */ + public ExplicitProxySettings 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 ExplicitProxySettings object itself. + */ + public ExplicitProxySettings withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + 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 ExplicitProxySettings object itself. + */ + public ExplicitProxySettings 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 ExplicitProxySettings object itself. + */ + public ExplicitProxySettings 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..a39a687d4e1bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitInner innerModel(); + + /** The entirety of the ExpressRouteCircuit definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuit definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuit definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteCircuit definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ExpressRouteCircuit definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteCircuit definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithAllowClassicOperations, + DefinitionStages.WithCircuitProvisioningState, + DefinitionStages.WithServiceProviderProvisioningState, + DefinitionStages.WithAuthorizations, + DefinitionStages.WithPeerings, + DefinitionStages.WithServiceKey, + DefinitionStages.WithServiceProviderNotes, + DefinitionStages.WithServiceProviderProperties, + DefinitionStages.WithExpressRoutePort, + DefinitionStages.WithBandwidthInGbps, + DefinitionStages.WithGatewayManagerEtag, + DefinitionStages.WithGlobalReachEnabled, + 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..a41460fc7d816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ARP table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitArpTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitArpTable.class); + + /* + * Entry age in minutes. + */ + @JsonProperty(value = "age") + private Integer age; + + /* + * Interface address. + */ + @JsonProperty(value = "interface") + private String interfaceProperty; + + /* + * The IP address. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * Get the age property: Entry age in minutes. + * + * @return the age value. + */ + public Integer age() { + return this.age; + } + + /** + * Set the age property: Entry age in minutes. + * + * @param age the age value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get the interfaceProperty property: Interface address. + * + * @return the interfaceProperty value. + */ + public String interfaceProperty() { + return this.interfaceProperty; + } + + /** + * Set the interfaceProperty property: Interface address. + * + * @param interfaceProperty the interfaceProperty value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withInterfaceProperty(String interfaceProperty) { + this.interfaceProperty = interfaceProperty; + return this; + } + + /** + * Get the ipAddress property: The IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the macAddress property: The MAC address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: The MAC address. + * + * @param macAddress the macAddress value to set. + * @return the ExpressRouteCircuitArpTable object itself. + */ + public ExpressRouteCircuitArpTable withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java new file mode 100644 index 0000000000000..f608fb85f2f23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; + +/** An immutable client-side representation of ExpressRouteCircuitAuthorization. */ +public interface ExpressRouteCircuitAuthorization { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + AuthorizationUseStatus authorizationUseStatus(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitAuthorizationInner innerModel(); + + /** The entirety of the ExpressRouteCircuitAuthorization definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitAuthorization definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitAuthorization definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @return the next definition stage. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + /** + * The stage of the ExpressRouteCircuitAuthorization definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithAuthorizationKey, + DefinitionStages.WithAuthorizationUseStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitAuthorization create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitAuthorization create(Context context); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitAuthorization definition allowing to specify authorizationUseStatus. */ + interface WithAuthorizationUseStatus { + /** + * Specifies the authorizationUseStatus property: The authorization use status.. + * + * @param authorizationUseStatus The authorization use status. + * @return the next definition stage. + */ + WithCreate withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + } + /** + * Begins update for the ExpressRouteCircuitAuthorization resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitAuthorization.Update update(); + + /** The template for ExpressRouteCircuitAuthorization update. */ + interface Update + extends UpdateStages.WithName, UpdateStages.WithAuthorizationKey, UpdateStages.WithAuthorizationUseStatus { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitAuthorization apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitAuthorization apply(Context context); + } + /** The ExpressRouteCircuitAuthorization update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitAuthorization update allowing to specify authorizationUseStatus. */ + interface WithAuthorizationUseStatus { + /** + * Specifies the authorizationUseStatus property: The authorization use status.. + * + * @param authorizationUseStatus The authorization use status. + * @return the next definition stage. + */ + Update withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitAuthorization refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitAuthorization refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java new file mode 100644 index 0000000000000..13b04605807e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuitAuthorizations. */ +public interface ExpressRouteCircuitAuthorizations { + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit. + */ + ExpressRouteCircuitAuthorization get(String resourceGroupName, String circuitName, String authorizationName); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String authorizationName, Context context); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all authorizations in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all authorizations in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, Context context); + + /** + * Gets the specified authorization from the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified authorization from the specified express route circuit 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..cf760b7924eae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; + +/** An immutable client-side representation of ExpressRouteCircuitConnection. */ +public interface ExpressRouteCircuitConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * Gets the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * Gets the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route circuit + * connection. + * + * @return the ipv6CircuitConnectionConfig value. + */ + Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig(); + + /** + * Gets the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * Gets the provisioningState property: The provisioning state of the express route circuit connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner + * object. + * + * @return the inner object. + */ + ExpressRouteCircuitConnectionInner innerModel(); + + /** The entirety of the ExpressRouteCircuitConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName, peeringName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @return the next definition stage. + */ + WithCreate withExistingPeering(String resourceGroupName, String circuitName, String peeringName); + } + /** + * The stage of the ExpressRouteCircuitConnection definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithExpressRouteCircuitPeering, + DefinitionStages.WithPeerExpressRouteCircuitPeering, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithAuthorizationKey, + DefinitionStages.WithIpv6CircuitConnectionConfig { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitConnection create(Context context); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify expressRouteCircuitPeering. */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the circuit initiating connection.. + * + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * @return the next definition stage. + */ + WithCreate withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + /** + * The stage of the ExpressRouteCircuitConnection definition allowing to specify peerExpressRouteCircuitPeering. + */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the peered circuit.. + * + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + * @return the next definition stage. + */ + WithCreate withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels.. + * + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the ExpressRouteCircuitConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** + * The stage of the ExpressRouteCircuitConnection definition allowing to specify ipv6CircuitConnectionConfig. + */ + interface WithIpv6CircuitConnectionConfig { + /** + * Specifies the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route + * circuit connection.. + * + * @param ipv6CircuitConnectionConfig IPv6 Address PrefixProperties of the express route circuit connection. + * @return the next definition stage. + */ + WithCreate withIpv6CircuitConnectionConfig(Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig); + } + } + /** + * Begins update for the ExpressRouteCircuitConnection resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitConnection.Update update(); + + /** The template for ExpressRouteCircuitConnection update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithExpressRouteCircuitPeering, + UpdateStages.WithPeerExpressRouteCircuitPeering, + UpdateStages.WithAddressPrefix, + UpdateStages.WithAuthorizationKey, + UpdateStages.WithIpv6CircuitConnectionConfig { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitConnection apply(Context context); + } + /** The ExpressRouteCircuitConnection update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitConnection update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify expressRouteCircuitPeering. */ + interface WithExpressRouteCircuitPeering { + /** + * Specifies the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the circuit initiating connection.. + * + * @param expressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * circuit initiating connection. + * @return the next definition stage. + */ + Update withExpressRouteCircuitPeering(SubResource expressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify peerExpressRouteCircuitPeering. */ + interface WithPeerExpressRouteCircuitPeering { + /** + * Specifies the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering + * Resource of the peered circuit.. + * + * @param peerExpressRouteCircuitPeering Reference to Express Route Circuit Private Peering Resource of the + * peered circuit. + * @return the next definition stage. + */ + Update withPeerExpressRouteCircuitPeering(SubResource peerExpressRouteCircuitPeering); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels.. + * + * @param addressPrefix /29 IP address space to carve out Customer addresses for tunnels. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorization key.. + * + * @param authorizationKey The authorization key. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the ExpressRouteCircuitConnection update allowing to specify ipv6CircuitConnectionConfig. */ + interface WithIpv6CircuitConnectionConfig { + /** + * Specifies the ipv6CircuitConnectionConfig property: IPv6 Address PrefixProperties of the express route + * circuit connection.. + * + * @param ipv6CircuitConnectionConfig IPv6 Address PrefixProperties of the express route circuit connection. + * @return the next definition stage. + */ + Update withIpv6CircuitConnectionConfig(Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java new file mode 100644 index 0000000000000..4a9fd90bd2a5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListConnections API service call retrieves all global reach connections that belongs to a Private + * Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitConnectionListResult.class); + + /* + * The global reach connection associated with Private Peering in an + * ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The global reach connection associated with Private Peering in an ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitConnectionListResult object itself. + */ + public ExpressRouteCircuitConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitConnectionListResult object itself. + */ + public ExpressRouteCircuitConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..b835e893bf56c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.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 ExpressRouteCircuitConnections. */ +public interface ExpressRouteCircuitConnections { + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Deletes the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit. + */ + ExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets the specified Express Route Circuit Connection from the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Express Route Circuit Connection from the specified express route circuit 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..f622c4f91db43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCircuit API service call. */ +@Fluent +public final class ExpressRouteCircuitListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitListResult.class); + + /* + * A list of ExpressRouteCircuits in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteCircuits in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteCircuits in a resource group. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitListResult object itself. + */ + public ExpressRouteCircuitListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitListResult object itself. + */ + public ExpressRouteCircuitListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java new file mode 100644 index 0000000000000..75097a2ca7ccd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java @@ -0,0 +1,680 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteCircuitPeering. */ +public interface ExpressRouteCircuitPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the peeringType property: The peering type. + * + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * Gets the state property: The peering state. + * + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * Gets the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + Integer azureAsn(); + + /** + * Gets the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * Gets the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * Gets the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * Gets the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * Gets the stats property: The peering stats of express route circuit. + * + * @return the stats value. + */ + ExpressRouteCircuitStats stats(); + + /** + * Gets the provisioningState property: The provisioning state of the express route circuit peering resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * Gets the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + SubResource routeFilter(); + + /** + * Gets the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * Gets the expressRouteConnection property: The ExpressRoute connection. + * + * @return the expressRouteConnection value. + */ + ExpressRouteConnectionId expressRouteConnection(); + + /** + * Gets the connections property: The list of circuit connections associated with Azure Private Peering for this + * circuit. + * + * @return the connections value. + */ + List connections(); + + /** + * Gets the peeredConnections property: The list of peered circuit connections associated with Azure Private Peering + * for this circuit. + * + * @return the peeredConnections value. + */ + List peeredConnections(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitPeeringInner innerModel(); + + /** The entirety of the ExpressRouteCircuitPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteCircuitPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCircuitPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, circuitName. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @return the next definition stage. + */ + WithCreate withExistingExpressRouteCircuit(String resourceGroupName, String circuitName); + } + /** + * The stage of the ExpressRouteCircuitPeering definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithPeeringType, + DefinitionStages.WithState, + DefinitionStages.WithAzureAsn, + DefinitionStages.WithPeerAsn, + DefinitionStages.WithPrimaryPeerAddressPrefix, + DefinitionStages.WithSecondaryPeerAddressPrefix, + DefinitionStages.WithPrimaryAzurePort, + DefinitionStages.WithSecondaryAzurePort, + DefinitionStages.WithSharedKey, + DefinitionStages.WithVlanId, + DefinitionStages.WithMicrosoftPeeringConfig, + DefinitionStages.WithStats, + DefinitionStages.WithGatewayManagerEtag, + DefinitionStages.WithRouteFilter, + DefinitionStages.WithIpv6PeeringConfig, + DefinitionStages.WithExpressRouteConnection, + DefinitionStages.WithConnections { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCircuitPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCircuitPeering create(Context context); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify peeringType. */ + interface WithPeeringType { + /** + * Specifies the peeringType property: The peering type.. + * + * @param peeringType The peering type. + * @return the next definition stage. + */ + WithCreate withPeeringType(ExpressRoutePeeringType peeringType); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The peering state.. + * + * @param state The peering state. + * @return the next definition stage. + */ + WithCreate withState(ExpressRoutePeeringState state); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify azureAsn. */ + interface WithAzureAsn { + /** + * Specifies the azureAsn property: The Azure ASN.. + * + * @param azureAsn The Azure ASN. + * @return the next definition stage. + */ + WithCreate withAzureAsn(Integer azureAsn); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: The peer ASN.. + * + * @param peerAsn The peer ASN. + * @return the next definition stage. + */ + WithCreate withPeerAsn(Long peerAsn); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify primaryPeerAddressPrefix. */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies the primaryPeerAddressPrefix property: The primary address prefix.. + * + * @param primaryPeerAddressPrefix The primary address prefix. + * @return the next definition stage. + */ + WithCreate withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify secondaryPeerAddressPrefix. */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies the secondaryPeerAddressPrefix property: The secondary address prefix.. + * + * @param secondaryPeerAddressPrefix The secondary address prefix. + * @return the next definition stage. + */ + WithCreate withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify primaryAzurePort. */ + interface WithPrimaryAzurePort { + /** + * Specifies the primaryAzurePort property: The primary port.. + * + * @param primaryAzurePort The primary port. + * @return the next definition stage. + */ + WithCreate withPrimaryAzurePort(String primaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify secondaryAzurePort. */ + interface WithSecondaryAzurePort { + /** + * Specifies the secondaryAzurePort property: The secondary port.. + * + * @param secondaryAzurePort The secondary port. + * @return the next definition stage. + */ + WithCreate withSecondaryAzurePort(String secondaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The shared key.. + * + * @param sharedKey The shared key. + * @return the next definition stage. + */ + WithCreate withSharedKey(String sharedKey); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: The VLAN ID.. + * + * @param vlanId The VLAN ID. + * @return the next definition stage. + */ + WithCreate withVlanId(Integer vlanId); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify microsoftPeeringConfig. */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies the microsoftPeeringConfig property: The Microsoft peering configuration.. + * + * @param microsoftPeeringConfig The Microsoft peering configuration. + * @return the next definition stage. + */ + WithCreate withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify stats. */ + interface WithStats { + /** + * Specifies the stats property: The peering stats of express route circuit.. + * + * @param stats The peering stats of express route circuit. + * @return the next definition stage. + */ + WithCreate withStats(ExpressRouteCircuitStatsInner stats); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify gatewayManagerEtag. */ + interface WithGatewayManagerEtag { + /** + * Specifies the gatewayManagerEtag property: The GatewayManager Etag.. + * + * @param gatewayManagerEtag The GatewayManager Etag. + * @return the next definition stage. + */ + WithCreate withGatewayManagerEtag(String gatewayManagerEtag); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify routeFilter. */ + interface WithRouteFilter { + /** + * Specifies the routeFilter property: The reference to the RouteFilter resource.. + * + * @param routeFilter The reference to the RouteFilter resource. + * @return the next definition stage. + */ + WithCreate withRouteFilter(SubResource routeFilter); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify ipv6PeeringConfig. */ + interface WithIpv6PeeringConfig { + /** + * Specifies the ipv6PeeringConfig property: The IPv6 peering configuration.. + * + * @param ipv6PeeringConfig The IPv6 peering configuration. + * @return the next definition stage. + */ + WithCreate withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify expressRouteConnection. */ + interface WithExpressRouteConnection { + /** + * Specifies the expressRouteConnection property: The ExpressRoute connection.. + * + * @param expressRouteConnection The ExpressRoute connection. + * @return the next definition stage. + */ + WithCreate withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + /** The stage of the ExpressRouteCircuitPeering definition allowing to specify connections. */ + interface WithConnections { + /** + * Specifies the connections property: The list of circuit connections associated with Azure Private Peering + * for this circuit.. + * + * @param connections The list of circuit connections associated with Azure Private Peering for this + * circuit. + * @return the next definition stage. + */ + WithCreate withConnections(List connections); + } + } + /** + * Begins update for the ExpressRouteCircuitPeering resource. + * + * @return the stage of resource update. + */ + ExpressRouteCircuitPeering.Update update(); + + /** The template for ExpressRouteCircuitPeering update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithPeeringType, + UpdateStages.WithState, + UpdateStages.WithAzureAsn, + UpdateStages.WithPeerAsn, + UpdateStages.WithPrimaryPeerAddressPrefix, + UpdateStages.WithSecondaryPeerAddressPrefix, + UpdateStages.WithPrimaryAzurePort, + UpdateStages.WithSecondaryAzurePort, + UpdateStages.WithSharedKey, + UpdateStages.WithVlanId, + UpdateStages.WithMicrosoftPeeringConfig, + UpdateStages.WithStats, + UpdateStages.WithGatewayManagerEtag, + UpdateStages.WithRouteFilter, + UpdateStages.WithIpv6PeeringConfig, + UpdateStages.WithExpressRouteConnection, + UpdateStages.WithConnections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCircuitPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCircuitPeering apply(Context context); + } + /** The ExpressRouteCircuitPeering update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCircuitPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify peeringType. */ + interface WithPeeringType { + /** + * Specifies the peeringType property: The peering type.. + * + * @param peeringType The peering type. + * @return the next definition stage. + */ + Update withPeeringType(ExpressRoutePeeringType peeringType); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The peering state.. + * + * @param state The peering state. + * @return the next definition stage. + */ + Update withState(ExpressRoutePeeringState state); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify azureAsn. */ + interface WithAzureAsn { + /** + * Specifies the azureAsn property: The Azure ASN.. + * + * @param azureAsn The Azure ASN. + * @return the next definition stage. + */ + Update withAzureAsn(Integer azureAsn); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: The peer ASN.. + * + * @param peerAsn The peer ASN. + * @return the next definition stage. + */ + Update withPeerAsn(Long peerAsn); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify primaryPeerAddressPrefix. */ + interface WithPrimaryPeerAddressPrefix { + /** + * Specifies the primaryPeerAddressPrefix property: The primary address prefix.. + * + * @param primaryPeerAddressPrefix The primary address prefix. + * @return the next definition stage. + */ + Update withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify secondaryPeerAddressPrefix. */ + interface WithSecondaryPeerAddressPrefix { + /** + * Specifies the secondaryPeerAddressPrefix property: The secondary address prefix.. + * + * @param secondaryPeerAddressPrefix The secondary address prefix. + * @return the next definition stage. + */ + Update withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify primaryAzurePort. */ + interface WithPrimaryAzurePort { + /** + * Specifies the primaryAzurePort property: The primary port.. + * + * @param primaryAzurePort The primary port. + * @return the next definition stage. + */ + Update withPrimaryAzurePort(String primaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify secondaryAzurePort. */ + interface WithSecondaryAzurePort { + /** + * Specifies the secondaryAzurePort property: The secondary port.. + * + * @param secondaryAzurePort The secondary port. + * @return the next definition stage. + */ + Update withSecondaryAzurePort(String secondaryAzurePort); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The shared key.. + * + * @param sharedKey The shared key. + * @return the next definition stage. + */ + Update withSharedKey(String sharedKey); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify vlanId. */ + interface WithVlanId { + /** + * Specifies the vlanId property: The VLAN ID.. + * + * @param vlanId The VLAN ID. + * @return the next definition stage. + */ + Update withVlanId(Integer vlanId); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify microsoftPeeringConfig. */ + interface WithMicrosoftPeeringConfig { + /** + * Specifies the microsoftPeeringConfig property: The Microsoft peering configuration.. + * + * @param microsoftPeeringConfig The Microsoft peering configuration. + * @return the next definition stage. + */ + Update withMicrosoftPeeringConfig(ExpressRouteCircuitPeeringConfig microsoftPeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify stats. */ + interface WithStats { + /** + * Specifies the stats property: The peering stats of express route circuit.. + * + * @param stats The peering stats of express route circuit. + * @return the next definition stage. + */ + Update withStats(ExpressRouteCircuitStatsInner stats); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify gatewayManagerEtag. */ + interface WithGatewayManagerEtag { + /** + * Specifies the gatewayManagerEtag property: The GatewayManager Etag.. + * + * @param gatewayManagerEtag The GatewayManager Etag. + * @return the next definition stage. + */ + Update withGatewayManagerEtag(String gatewayManagerEtag); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify routeFilter. */ + interface WithRouteFilter { + /** + * Specifies the routeFilter property: The reference to the RouteFilter resource.. + * + * @param routeFilter The reference to the RouteFilter resource. + * @return the next definition stage. + */ + Update withRouteFilter(SubResource routeFilter); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify ipv6PeeringConfig. */ + interface WithIpv6PeeringConfig { + /** + * Specifies the ipv6PeeringConfig property: The IPv6 peering configuration.. + * + * @param ipv6PeeringConfig The IPv6 peering configuration. + * @return the next definition stage. + */ + Update withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify expressRouteConnection. */ + interface WithExpressRouteConnection { + /** + * Specifies the expressRouteConnection property: The ExpressRoute connection.. + * + * @param expressRouteConnection The ExpressRoute connection. + * @return the next definition stage. + */ + Update withExpressRouteConnection(ExpressRouteConnectionId expressRouteConnection); + } + /** The stage of the ExpressRouteCircuitPeering update allowing to specify connections. */ + interface WithConnections { + /** + * Specifies the connections property: The list of circuit connections associated with Azure Private Peering + * for this circuit.. + * + * @param connections The list of circuit connections associated with Azure Private Peering for this + * circuit. + * @return the next definition stage. + */ + Update withConnections(List connections); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCircuitPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCircuitPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java new file mode 100644 index 0000000000000..a161364f51fce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ +public final class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + extends ExpandableStringEnum { + /** Static value NotConfigured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState NOT_CONFIGURED = + fromString("NotConfigured"); + + /** Static value Configuring for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURING = fromString("Configuring"); + + /** Static value Configured for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState CONFIGURED = fromString("Configured"); + + /** Static value ValidationNeeded for ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. */ + public static final ExpressRouteCircuitPeeringAdvertisedPublicPrefixState VALIDATION_NEEDED = + fromString("ValidationNeeded"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ + @JsonCreator + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** @return known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values. */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..3c544891aa3fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies the peering configuration. */ +@Fluent +public final class ExpressRouteCircuitPeeringConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringConfig.class); + + /* + * The reference to AdvertisedPublicPrefixes. + */ + @JsonProperty(value = "advertisedPublicPrefixes") + private List advertisedPublicPrefixes; + + /* + * The communities of bgp peering. Specified for microsoft peering. + */ + @JsonProperty(value = "advertisedCommunities") + private List advertisedCommunities; + + /* + * The advertised public prefix state of the Peering resource. + */ + @JsonProperty(value = "advertisedPublicPrefixesState", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /* + * The legacy mode of the peering. + */ + @JsonProperty(value = "legacyMode") + private Integer legacyMode; + + /* + * The CustomerASN of the peering. + */ + @JsonProperty(value = "customerASN") + private Integer customerAsn; + + /* + * The RoutingRegistryName of the configuration. + */ + @JsonProperty(value = "routingRegistryName") + private String routingRegistryName; + + /** + * Get the advertisedPublicPrefixes property: The reference to AdvertisedPublicPrefixes. + * + * @return the advertisedPublicPrefixes value. + */ + public List advertisedPublicPrefixes() { + return this.advertisedPublicPrefixes; + } + + /** + * Set the advertisedPublicPrefixes property: The reference to AdvertisedPublicPrefixes. + * + * @param advertisedPublicPrefixes the advertisedPublicPrefixes value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedPublicPrefixes(List advertisedPublicPrefixes) { + this.advertisedPublicPrefixes = advertisedPublicPrefixes; + return this; + } + + /** + * Get the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. + * + * @return the advertisedCommunities value. + */ + public List advertisedCommunities() { + return this.advertisedCommunities; + } + + /** + * Set the advertisedCommunities property: The communities of bgp peering. Specified for microsoft peering. + * + * @param advertisedCommunities the advertisedCommunities value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withAdvertisedCommunities(List advertisedCommunities) { + this.advertisedCommunities = advertisedCommunities; + return this; + } + + /** + * Get the advertisedPublicPrefixesState property: The advertised public prefix state of the Peering resource. + * + * @return the advertisedPublicPrefixesState value. + */ + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState() { + return this.advertisedPublicPrefixesState; + } + + /** + * Get the legacyMode property: The legacy mode of the peering. + * + * @return the legacyMode value. + */ + public Integer legacyMode() { + return this.legacyMode; + } + + /** + * Set the legacyMode property: The legacy mode of the peering. + * + * @param legacyMode the legacyMode value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withLegacyMode(Integer legacyMode) { + this.legacyMode = legacyMode; + return this; + } + + /** + * Get the customerAsn property: The CustomerASN of the peering. + * + * @return the customerAsn value. + */ + public Integer customerAsn() { + return this.customerAsn; + } + + /** + * Set the customerAsn property: The CustomerASN of the peering. + * + * @param customerAsn the customerAsn value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withCustomerAsn(Integer customerAsn) { + this.customerAsn = customerAsn; + return this; + } + + /** + * Get the routingRegistryName property: The RoutingRegistryName of the configuration. + * + * @return the routingRegistryName value. + */ + public String routingRegistryName() { + return this.routingRegistryName; + } + + /** + * Set the routingRegistryName property: The RoutingRegistryName of the configuration. + * + * @param routingRegistryName the routingRegistryName value to set. + * @return the ExpressRouteCircuitPeeringConfig object itself. + */ + public ExpressRouteCircuitPeeringConfig withRoutingRegistryName(String routingRegistryName) { + this.routingRegistryName = routingRegistryName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java new file mode 100644 index 0000000000000..fd666af74daf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoute circuit peering identifier. */ +@Fluent +public final class ExpressRouteCircuitPeeringId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringId.class); + + /* + * The ID of the ExpressRoute circuit peering. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The ID of the ExpressRoute circuit peering. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the ExpressRoute circuit peering. + * + * @param id the id value to set. + * @return the ExpressRouteCircuitPeeringId object itself. + */ + public ExpressRouteCircuitPeeringId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java new file mode 100644 index 0000000000000..88353b03882dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitPeeringListResult.class); + + /* + * The peerings in an express route circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The peerings in an express route circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in an express route circuit. + * + * @param value the value value to set. + * @return the ExpressRouteCircuitPeeringListResult object itself. + */ + public ExpressRouteCircuitPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteCircuitPeeringListResult object itself. + */ + public ExpressRouteCircuitPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..8a5374b0f131f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitPeeringState. */ +public final class ExpressRouteCircuitPeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteCircuitPeeringState. */ + public static final ExpressRouteCircuitPeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringState. + */ + @JsonCreator + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** @return known ExpressRouteCircuitPeeringState values. */ + public static Collection values() { + return values(ExpressRouteCircuitPeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java new file mode 100644 index 0000000000000..ff74488c004bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuitPeerings. */ +public interface ExpressRouteCircuitPeerings { + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String peeringName); + + /** + * Deletes the specified peering from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit. + */ + ExpressRouteCircuitPeering get(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets the specified peering for the express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName); + + /** + * Gets all peerings in a specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified express route circuit. + */ + PagedIterable list(String resourceGroupName, String circuitName, Context context); + + /** + * Gets the specified peering for the express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the express route circuit 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..2c07a8b516f0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to an express route circuit. */ +@Fluent +public final class ExpressRouteCircuitReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitReference.class); + + /* + * Corresponding Express Route Circuit Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Corresponding Express Route Circuit Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Corresponding Express Route Circuit Id. + * + * @param id the id value to set. + * @return the ExpressRouteCircuitReference object itself. + */ + public ExpressRouteCircuitReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java new file mode 100644 index 0000000000000..33be99caaaedc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTable.class); + + /* + * IP address of a network entity. + */ + @JsonProperty(value = "network") + private String network; + + /* + * NextHop address. + */ + @JsonProperty(value = "nextHop") + private String nextHop; + + /* + * Local preference value as set with the set local-preference route-map + * configuration command. + */ + @JsonProperty(value = "locPrf") + private String locPrf; + + /* + * Route Weight. + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Autonomous system paths to the destination network. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the network property: IP address of a network entity. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Set the network property: IP address of a network entity. + * + * @param network the network value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNetwork(String network) { + this.network = network; + return this; + } + + /** + * Get the nextHop property: NextHop address. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: NextHop address. + * + * @param nextHop the nextHop value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Get the locPrf property: Local preference value as set with the set local-preference route-map configuration + * command. + * + * @return the locPrf value. + */ + public String locPrf() { + return this.locPrf; + } + + /** + * Set the locPrf property: Local preference value as set with the set local-preference route-map configuration + * command. + * + * @param locPrf the locPrf value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withLocPrf(String locPrf) { + this.locPrf = locPrf; + return this; + } + + /** + * Get the weight property: Route Weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Route Weight. + * + * @param weight the weight value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the path property: Autonomous system paths to the destination network. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Autonomous system paths to the destination network. + * + * @param path the path value to set. + * @return the ExpressRouteCircuitRoutesTable object itself. + */ + public ExpressRouteCircuitRoutesTable withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java new file mode 100644 index 0000000000000..bd28e694e106a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitRoutesTableSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitRoutesTableSummary.class); + + /* + * IP address of the neighbor. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * BGP version number spoken to the neighbor. + */ + @JsonProperty(value = "v") + private Integer v; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "as") + private Integer as; + + /* + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "statePfxRcd") + private String statePfxRcd; + + /** + * Get the neighbor property: IP address of the neighbor. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set the neighbor property: IP address of the neighbor. + * + * @param neighbor the neighbor value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get the v property: BGP version number spoken to the neighbor. + * + * @return the v value. + */ + public Integer v() { + return this.v; + } + + /** + * Set the v property: BGP version number spoken to the neighbor. + * + * @param v the v value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withV(Integer v) { + this.v = v; + return this; + } + + /** + * Get the as property: Autonomous system number. + * + * @return the as value. + */ + public Integer as() { + return this.as; + } + + /** + * Set the as property: Autonomous system number. + * + * @param as the as value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) { + this.as = as; + return this; + } + + /** + * Get the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @return the upDown value. + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @param upDown the upDown value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been + * received from a neighbor or peer group. + * + * @return the statePfxRcd value. + */ + public String statePfxRcd() { + return this.statePfxRcd; + } + + /** + * Set the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been + * received from a neighbor or peer group. + * + * @param statePfxRcd the statePfxRcd value to set. + * @return the ExpressRouteCircuitRoutesTableSummary object itself. + */ + public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) { + this.statePfxRcd = statePfxRcd; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java new file mode 100644 index 0000000000000..201e91ce7014b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains ServiceProviderProperties in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitServiceProviderProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitServiceProviderProperties.class); + + /* + * The serviceProviderName. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /* + * The peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * The BandwidthInMbps. + */ + @JsonProperty(value = "bandwidthInMbps") + private Integer bandwidthInMbps; + + /** + * Get the serviceProviderName property: The serviceProviderName. + * + * @return the serviceProviderName value. + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName property: The serviceProviderName. + * + * @param serviceProviderName the serviceProviderName value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + return this; + } + + /** + * Get the peeringLocation property: The peering location. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The peering location. + * + * @param peeringLocation the peeringLocation value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the bandwidthInMbps property: The BandwidthInMbps. + * + * @return the bandwidthInMbps value. + */ + public Integer bandwidthInMbps() { + return this.bandwidthInMbps; + } + + /** + * Set the bandwidthInMbps property: The BandwidthInMbps. + * + * @param bandwidthInMbps the bandwidthInMbps value to set. + * @return the ExpressRouteCircuitServiceProviderProperties object itself. + */ + public ExpressRouteCircuitServiceProviderProperties withBandwidthInMbps(Integer bandwidthInMbps) { + this.bandwidthInMbps = bandwidthInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java new file mode 100644 index 0000000000000..7847eee8a0bfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains SKU in an ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCircuitSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCircuitSku.class); + + /* + * The name of the SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The tier of the SKU. + */ + @JsonProperty(value = "tier") + private ExpressRouteCircuitSkuTier tier; + + /* + * The family of the SKU. + */ + @JsonProperty(value = "family") + private ExpressRouteCircuitSkuFamily family; + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of the SKU. + * + * @return the tier value. + */ + public ExpressRouteCircuitSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the SKU. + * + * @param tier the tier value to set. + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the family property: The family of the SKU. + * + * @return the family value. + */ + public ExpressRouteCircuitSkuFamily family() { + return this.family; + } + + /** + * Set the family property: The family of the SKU. + * + * @param family the family value to set. + * @return the ExpressRouteCircuitSku object itself. + */ + public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) { + this.family = family; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java new file mode 100644 index 0000000000000..67ae9253d9188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitSkuFamily. */ +public final class ExpressRouteCircuitSkuFamily extends ExpandableStringEnum { + /** Static value UnlimitedData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily UNLIMITED_DATA = fromString("UnlimitedData"); + + /** Static value MeteredData for ExpressRouteCircuitSkuFamily. */ + public static final ExpressRouteCircuitSkuFamily METERED_DATA = fromString("MeteredData"); + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuFamily. + */ + @JsonCreator + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** @return known ExpressRouteCircuitSkuFamily values. */ + public static Collection values() { + return values(ExpressRouteCircuitSkuFamily.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java new file mode 100644 index 0000000000000..a46e6c0a3f8c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteCircuitSkuTier. */ +public final class ExpressRouteCircuitSkuTier extends ExpandableStringEnum { + /** Static value Standard for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier PREMIUM = fromString("Premium"); + + /** Static value Basic for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier BASIC = fromString("Basic"); + + /** Static value Local for ExpressRouteCircuitSkuTier. */ + public static final ExpressRouteCircuitSkuTier LOCAL = fromString("Local"); + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuTier. + */ + @JsonCreator + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** @return known ExpressRouteCircuitSkuTier values. */ + public static Collection values() { + return values(ExpressRouteCircuitSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java new file mode 100644 index 0000000000000..671681671b22d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner; + +/** An immutable client-side representation of ExpressRouteCircuitStats. */ +public interface ExpressRouteCircuitStats { + /** + * Gets the primarybytesIn property: The Primary BytesIn of the peering. + * + * @return the primarybytesIn value. + */ + Long primarybytesIn(); + + /** + * Gets the primarybytesOut property: The primary BytesOut of the peering. + * + * @return the primarybytesOut value. + */ + Long primarybytesOut(); + + /** + * Gets the secondarybytesIn property: The secondary BytesIn of the peering. + * + * @return the secondarybytesIn value. + */ + Long secondarybytesIn(); + + /** + * Gets the secondarybytesOut property: The secondary BytesOut of the peering. + * + * @return the secondarybytesOut value. + */ + Long secondarybytesOut(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitStatsInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitStatsInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java new file mode 100644 index 0000000000000..0106faebceafe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCircuits. */ +public interface ExpressRouteCircuits { + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Deletes the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String circuitName, Context context); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit. + */ + ExpressRouteCircuit getByResourceGroup(String resourceGroupName, String circuitName); + + /** + * Gets information about the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route circuit in a resource group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table summary associated with the express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table summary associated with the express route circuit in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String circuitName, String peeringName, String devicePath, Context context); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group. + */ + ExpressRouteCircuitStats getStats(String resourceGroupName, String circuitName); + + /** + * Gets all the stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the stats from an express route circuit in a resource group along with {@link Response}. + */ + Response getStatsWithResponse( + String resourceGroupName, String circuitName, Context context); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group. + */ + ExpressRouteCircuitStats getPeeringStats(String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all stats from an express route circuit in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all stats from an express route circuit in a resource group along with {@link Response}. + */ + Response getPeeringStatsWithResponse( + String resourceGroupName, String circuitName, String peeringName, Context context); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the express route circuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the express route circuits in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the express route circuits in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the express route circuits in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets information about the specified express route circuit. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified express route circuit 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..38ecf7bbfefbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; + +/** An immutable client-side representation of ExpressRouteConnection. */ +public interface ExpressRouteConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the provisioningState property: The provisioning state of the express route connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the expressRouteCircuitPeering property: The ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value. + */ + ExpressRouteCircuitPeeringId expressRouteCircuitPeering(); + + /** + * Gets the authorizationKey property: Authorization key to establish the connection. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the routingWeight property: The routing weight associated to the connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the expressRouteGatewayBypass property: Enable FastPath to vWan Firewall hub. + * + * @return the expressRouteGatewayBypass value. + */ + Boolean expressRouteGatewayBypass(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner object. + * + * @return the inner object. + */ + ExpressRouteConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java new file mode 100644 index 0000000000000..528ebb92f1414 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ID of the ExpressRouteConnection. */ +@Immutable +public final class ExpressRouteConnectionId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteConnectionId.class); + + /* + * The ID of the ExpressRouteConnection. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ID of the ExpressRouteConnection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java new file mode 100644 index 0000000000000..0e014f16c54b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteConnectionList. */ +public interface ExpressRouteConnectionList { + /** + * Gets the value property: The list of ExpressRoute connections. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionListInner object. + * + * @return the inner object. + */ + ExpressRouteConnectionListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java new file mode 100644 index 0000000000000..c1e6bf06026da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; + +/** Resource collection API of ExpressRouteConnections. */ +public interface ExpressRouteConnections { + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters); + + /** + * Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param putExpressRouteConnectionParameters Parameters required in an ExpressRouteConnection PUT operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection resource. + */ + ExpressRouteConnection createOrUpdate( + String resourceGroupName, + String expressRouteGatewayName, + String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, + Context context); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection. + */ + ExpressRouteConnection get(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Gets the specified ExpressRouteConnection. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the ExpressRoute connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ExpressRouteConnection along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName); + + /** + * Deletes a connection to a ExpressRoute circuit. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param connectionName The name of the connection subresource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRouteGatewayName, String connectionName, Context context); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list. + */ + ExpressRouteConnectionList list(String resourceGroupName, String expressRouteGatewayName); + + /** + * Lists ExpressRouteConnections. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteConnection list along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java new file mode 100644 index 0000000000000..03cf922969afe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteCrossConnection. */ +public interface ExpressRouteCrossConnection { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionInner innerModel(); + + /** The entirety of the ExpressRouteCrossConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteCrossConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteCrossConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteCrossConnection definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExpressRouteCircuit, + DefinitionStages.WithServiceProviderProvisioningState, + DefinitionStages.WithServiceProviderNotes, + DefinitionStages.WithPeerings { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteCrossConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteCrossConnection create(Context context); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify expressRouteCircuit. */ + interface WithExpressRouteCircuit { + /** + * Specifies the expressRouteCircuit property: The ExpressRouteCircuit.. + * + * @param expressRouteCircuit The ExpressRouteCircuit. + * @return the next definition stage. + */ + WithCreate withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit); + } + /** + * The stage of the ExpressRouteCrossConnection definition allowing to specify serviceProviderProvisioningState. + */ + interface WithServiceProviderProvisioningState { + /** + * Specifies the serviceProviderProvisioningState property: The provisioning state of the circuit in the + * connectivity provider system.. + * + * @param serviceProviderProvisioningState The provisioning state of the circuit in the connectivity + * provider system. + * @return the next definition stage. + */ + WithCreate withServiceProviderProvisioningState( + ServiceProviderProvisioningState serviceProviderProvisioningState); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify serviceProviderNotes. */ + interface WithServiceProviderNotes { + /** + * Specifies the serviceProviderNotes property: Additional read only notes set by the connectivity + * provider.. + * + * @param serviceProviderNotes Additional read only notes set by the connectivity provider. + * @return the next definition stage. + */ + WithCreate withServiceProviderNotes(String serviceProviderNotes); + } + /** The stage of the ExpressRouteCrossConnection definition allowing to specify peerings. */ + interface WithPeerings { + /** + * Specifies the peerings property: The list of peerings.. + * + * @param peerings The list of peerings. + * @return the next definition stage. + */ + WithCreate withPeerings(List peerings); + } + } + /** + * Begins update for the ExpressRouteCrossConnection resource. + * + * @return the stage of resource update. + */ + ExpressRouteCrossConnection.Update update(); + + /** The template for ExpressRouteCrossConnection update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteCrossConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteCrossConnection apply(Context context); + } + /** The ExpressRouteCrossConnection update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteCrossConnection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteCrossConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteCrossConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java new file mode 100644 index 0000000000000..94c149bcf5fc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListExpressRouteCrossConnection API service call. */ +@Fluent +public final class ExpressRouteCrossConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionListResult.class); + + /* + * A list of ExpressRouteCrossConnection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteCrossConnection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteCrossConnection resources. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionListResult object itself. + */ + public ExpressRouteCrossConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java new file mode 100644 index 0000000000000..a659710ea0fe4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** An immutable client-side representation of ExpressRouteCrossConnectionPeering. */ +public interface ExpressRouteCrossConnectionPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the peeringType property: The peering type. + * + * @return the peeringType value. + */ + ExpressRoutePeeringType peeringType(); + + /** + * Gets the state property: The peering state. + * + * @return the state value. + */ + ExpressRoutePeeringState state(); + + /** + * Gets the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + Integer azureAsn(); + + /** + * Gets the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + String primaryPeerAddressPrefix(); + + /** + * Gets the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + String secondaryPeerAddressPrefix(); + + /** + * Gets the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + String primaryAzurePort(); + + /** + * Gets the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + String secondaryAzurePort(); + + /** + * Gets the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + Integer vlanId(); + + /** + * Gets the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig(); + + /** + * Gets the provisioningState property: The provisioning state of the express route cross connection peering + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + String gatewayManagerEtag(); + + /** + * Gets the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + String lastModifiedBy(); + + /** + * Gets the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner + * object. + * + * @return the inner object. + */ + ExpressRouteCrossConnectionPeeringInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java new file mode 100644 index 0000000000000..95a229f73840a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionPeeringList.class); + + /* + * The peerings in an express route cross connection. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The peerings in an express route cross connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in an express route cross connection. + * + * @param value the value value to set. + * @return the ExpressRouteCrossConnectionPeeringList object itself. + */ + public ExpressRouteCrossConnectionPeeringList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java new file mode 100644 index 0000000000000..e49801528e1a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; + +/** Resource collection API of ExpressRouteCrossConnectionPeerings. */ +public interface ExpressRouteCrossConnectionPeerings { + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + PagedIterable list(String resourceGroupName, String crossConnectionName); + + /** + * Gets all peerings in a specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all peerings in a specified ExpressRouteCrossConnection. + */ + PagedIterable list( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Deletes the specified peering from the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String crossConnectionName, String peeringName, Context context); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection. + */ + ExpressRouteCrossConnectionPeering get(String resourceGroupName, String crossConnectionName, String peeringName); + + /** + * Gets the specified peering for the ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified peering for the ExpressRouteCrossConnection along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String crossConnectionName, String peeringName, Context context); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters); + + /** + * Creates or updates a peering in the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create or update ExpressRouteCrossConnection peering + * operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return peering in an ExpressRoute Cross Connection resource. + */ + ExpressRouteCrossConnectionPeering createOrUpdate( + String resourceGroupName, + String crossConnectionName, + String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java new file mode 100644 index 0000000000000..4e76e84a59395 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes table associated with the ExpressRouteCircuit. */ +@Fluent +public final class ExpressRouteCrossConnectionRoutesTableSummary { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteCrossConnectionRoutesTableSummary.class); + + /* + * IP address of Neighbor router. + */ + @JsonProperty(value = "neighbor") + private String neighbor; + + /* + * Autonomous system number. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /* + * The length of time that the BGP session has been in the Established + * state, or the current status if not in the Established state. + */ + @JsonProperty(value = "upDown") + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + */ + @JsonProperty(value = "stateOrPrefixesReceived") + private String stateOrPrefixesReceived; + + /** + * Get the neighbor property: IP address of Neighbor router. + * + * @return the neighbor value. + */ + public String neighbor() { + return this.neighbor; + } + + /** + * Set the neighbor property: IP address of Neighbor router. + * + * @param neighbor the neighbor value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withNeighbor(String neighbor) { + this.neighbor = neighbor; + return this; + } + + /** + * Get the asn property: Autonomous system number. + * + * @return the asn value. + */ + public Integer asn() { + return this.asn; + } + + /** + * Set the asn property: Autonomous system number. + * + * @param asn the asn value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @return the upDown value. + */ + public String upDown() { + return this.upDown; + } + + /** + * Set the upDown property: The length of time that the BGP session has been in the Established state, or the + * current status if not in the Established state. + * + * @param upDown the upDown value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withUpDown(String upDown) { + this.upDown = upDown; + return this; + } + + /** + * Get the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + * + * @return the stateOrPrefixesReceived value. + */ + public String stateOrPrefixesReceived() { + return this.stateOrPrefixesReceived; + } + + /** + * Set the stateOrPrefixesReceived property: Current state of the BGP session, and the number of prefixes that have + * been received from a neighbor or peer group. + * + * @param stateOrPrefixesReceived the stateOrPrefixesReceived value to set. + * @return the ExpressRouteCrossConnectionRoutesTableSummary object itself. + */ + public ExpressRouteCrossConnectionRoutesTableSummary withStateOrPrefixesReceived(String stateOrPrefixesReceived) { + this.stateOrPrefixesReceived = stateOrPrefixesReceived; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java new file mode 100644 index 0000000000000..46f61009fa675 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteCrossConnections. */ +public interface ExpressRouteCrossConnections { + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable list(Context context); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieves all the ExpressRouteCrossConnections in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection. + */ + ExpressRouteCrossConnection getByResourceGroup(String resourceGroupName, String crossConnectionName); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param resourceGroupName The name of the resource group (peering location of the circuit). + * @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String crossConnectionName, Context context); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised ARP table associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised ARP table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsArpTableListResult listArpTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the route table summary associated with the express route cross connection in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the route table summary associated with the express route cross connection in a resource group. + */ + ExpressRouteCrossConnectionsRoutesTableSummaryListResult listRoutesTableSummary( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath); + + /** + * Gets the currently advertised routes table associated with the express route cross connection in a resource + * group. + * + * @param resourceGroupName The name of the resource group. + * @param crossConnectionName The name of the ExpressRouteCrossConnection. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the currently advertised routes table associated with the express route cross connection in a resource + * group. + */ + ExpressRouteCircuitsRoutesTableListResult listRoutesTable( + String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context); + + /** + * Gets details about the specified ExpressRouteCrossConnection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about the specified ExpressRouteCrossConnection 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..91fca19aff61f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ExpressRouteGateway. */ +public interface ExpressRouteGateway { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayInner object. + * + * @return the inner object. + */ + ExpressRouteGatewayInner innerModel(); + + /** The entirety of the ExpressRouteGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRouteGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRouteGateway definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ExpressRouteGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRouteGateway definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithAutoScaleConfiguration, + DefinitionStages.WithVirtualHub { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteGateway create(Context context); + } + /** The stage of the ExpressRouteGateway definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ExpressRouteGateway definition allowing to specify autoScaleConfiguration. */ + interface WithAutoScaleConfiguration { + /** + * Specifies the autoScaleConfiguration property: Configuration for auto scaling.. + * + * @param autoScaleConfiguration Configuration for auto scaling. + * @return the next definition stage. + */ + WithCreate withAutoScaleConfiguration( + ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration); + } + /** The stage of the ExpressRouteGateway definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The Virtual Hub where the ExpressRoute gateway is or will be + * deployed.. + * + * @param virtualHub The Virtual Hub where the ExpressRoute gateway is or will be deployed. + * @return the next definition stage. + */ + WithCreate withVirtualHub(VirtualHubId virtualHub); + } + } + /** + * Begins update for the ExpressRouteGateway resource. + * + * @return the stage of resource update. + */ + ExpressRouteGateway.Update update(); + + /** The template for ExpressRouteGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteGateway apply(Context context); + } + /** The ExpressRouteGateway update stages. */ + interface UpdateStages { + /** The stage of the ExpressRouteGateway update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java new file mode 100644 index 0000000000000..56d586f2676c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner; +import java.util.List; + +/** An immutable client-side representation of ExpressRouteGatewayList. */ +public interface ExpressRouteGatewayList { + /** + * Gets the value property: List of ExpressRoute gateways. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteGatewayListInner object. + * + * @return the inner object. + */ + ExpressRouteGatewayListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java new file mode 100644 index 0000000000000..9647e53d95d76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for auto scaling. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfiguration.class); + + /* + * Minimum and maximum number of scale units to deploy. + */ + @JsonProperty(value = "bounds") + private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; + + /** + * Get the bounds property: Minimum and maximum number of scale units to deploy. + * + * @return the bounds value. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds() { + return this.bounds; + } + + /** + * Set the bounds property: Minimum and maximum number of scale units to deploy. + * + * @param bounds the bounds value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfiguration object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration withBounds( + ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds) { + this.bounds = bounds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bounds() != null) { + bounds().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java new file mode 100644 index 0000000000000..34eece58b4595 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Minimum and maximum number of scale units to deploy. */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.class); + + /* + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "min") + private Integer min; + + /* + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + @JsonProperty(value = "max") + private Integer max; + + /** + * Get the min property: Minimum number of scale units deployed for ExpressRoute gateway. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: Minimum number of scale units deployed for ExpressRoute gateway. + * + * @param min the min value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max property: Maximum number of scale units deployed for ExpressRoute gateway. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: Maximum number of scale units deployed for ExpressRoute gateway. + * + * @param max the max value to set. + * @return the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds object itself. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java new file mode 100644 index 0000000000000..6e430adebbae8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteGateways. */ +public interface ExpressRouteGateways { + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + ExpressRouteGatewayList listBySubscription(); + + /** + * Lists ExpressRoute gateways under a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + Response listBySubscriptionWithResponse(Context context); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways. + */ + ExpressRouteGatewayList listByResourceGroup(String resourceGroupName); + + /** + * Lists ExpressRoute gateways in a given resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of ExpressRoute gateways along with {@link Response}. + */ + Response listByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource. + */ + ExpressRouteGateway getByResourceGroup(String resourceGroupName, String expressRouteGatewayName); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRouteGatewayName, Context context); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String expressRouteGatewayName); + + /** + * Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be + * deleted when there are no connection subresources. + * + * @param resourceGroupName The name of the resource group. + * @param expressRouteGatewayName The name of the ExpressRoute gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRouteGatewayName, Context context); + + /** + * Fetches the details of a ExpressRoute gateway in a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute gateway resource 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..4d0827ad4e8b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; + +/** An immutable client-side representation of ExpressRouteLink. */ +public interface ExpressRouteLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of child port resource that is unique among child port resources of the parent. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routerName property: Name of Azure router associated with physical port. + * + * @return the routerName value. + */ + String routerName(); + + /** + * Gets the interfaceName property: Name of Azure router interface. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the patchPanelId property: Mapping between physical port to patch panel port. + * + * @return the patchPanelId value. + */ + String patchPanelId(); + + /** + * Gets the rackId property: Mapping of physical patch panel to rack. + * + * @return the rackId value. + */ + String rackId(); + + /** + * Gets the connectorType property: Physical fiber port type. + * + * @return the connectorType value. + */ + ExpressRouteLinkConnectorType connectorType(); + + /** + * Gets the adminState property: Administrative state of the physical port. + * + * @return the adminState value. + */ + ExpressRouteLinkAdminState adminState(); + + /** + * Gets the provisioningState property: The provisioning state of the express route link resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the macSecConfig property: 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..bef1094d29933 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkAdminState. */ +public final class ExpressRouteLinkAdminState extends ExpandableStringEnum { + /** Static value Enabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState ENABLED = fromString("Enabled"); + + /** Static value Disabled for ExpressRouteLinkAdminState. */ + public static final ExpressRouteLinkAdminState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ExpressRouteLinkAdminState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkAdminState. + */ + @JsonCreator + public static ExpressRouteLinkAdminState fromString(String name) { + return fromString(name, ExpressRouteLinkAdminState.class); + } + + /** @return known ExpressRouteLinkAdminState values. */ + public static Collection values() { + return values(ExpressRouteLinkAdminState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java new file mode 100644 index 0000000000000..ebdf087fed0c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkConnectorType. */ +public final class ExpressRouteLinkConnectorType extends ExpandableStringEnum { + /** Static value LC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType LC = fromString("LC"); + + /** Static value SC for ExpressRouteLinkConnectorType. */ + public static final ExpressRouteLinkConnectorType SC = fromString("SC"); + + /** + * Creates or finds a ExpressRouteLinkConnectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkConnectorType. + */ + @JsonCreator + public static ExpressRouteLinkConnectorType fromString(String name) { + return fromString(name, ExpressRouteLinkConnectorType.class); + } + + /** @return known ExpressRouteLinkConnectorType values. */ + public static Collection values() { + return values(ExpressRouteLinkConnectorType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java new file mode 100644 index 0000000000000..43d8a81f23711 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRouteLink List Result Response for ListExpressRouteLinks API service call. */ +@Fluent +public final class ExpressRouteLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkListResult.class); + + /* + * The list of ExpressRouteLink sub-resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of ExpressRouteLink sub-resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of ExpressRouteLink sub-resources. + * + * @param value the value value to set. + * @return the ExpressRouteLinkListResult object itself. + */ + public ExpressRouteLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteLinkListResult object itself. + */ + public ExpressRouteLinkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java new file mode 100644 index 0000000000000..c2ae1efdeebc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkMacSecCipher. */ +public final class ExpressRouteLinkMacSecCipher extends ExpandableStringEnum { + /** Static value GcmAes256 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES256 = fromString("GcmAes256"); + + /** Static value GcmAes128 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES128 = fromString("GcmAes128"); + + /** Static value GcmAesXpn128 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES_XPN128 = fromString("GcmAesXpn128"); + + /** Static value GcmAesXpn256 for ExpressRouteLinkMacSecCipher. */ + public static final ExpressRouteLinkMacSecCipher GCM_AES_XPN256 = fromString("GcmAesXpn256"); + + /** + * Creates or finds a ExpressRouteLinkMacSecCipher from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecCipher. + */ + @JsonCreator + public static ExpressRouteLinkMacSecCipher fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecCipher.class); + } + + /** @return known ExpressRouteLinkMacSecCipher values. */ + public static Collection values() { + return values(ExpressRouteLinkMacSecCipher.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java new file mode 100644 index 0000000000000..78259b4a77208 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Definition of ExpressRouteLink Mac Security configuration. ExpressRouteLink Mac Security Configuration. */ +@Fluent +public final class ExpressRouteLinkMacSecConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteLinkMacSecConfig.class); + + /* + * Keyvault Secret Identifier URL containing Mac security CKN key. + */ + @JsonProperty(value = "cknSecretIdentifier") + private String cknSecretIdentifier; + + /* + * Keyvault Secret Identifier URL containing Mac security CAK key. + */ + @JsonProperty(value = "cakSecretIdentifier") + private String cakSecretIdentifier; + + /* + * Mac security cipher. + */ + @JsonProperty(value = "cipher") + private ExpressRouteLinkMacSecCipher cipher; + + /* + * Sci mode enabled/disabled. + */ + @JsonProperty(value = "sciState") + private ExpressRouteLinkMacSecSciState sciState; + + /** + * Get the cknSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CKN key. + * + * @return the cknSecretIdentifier value. + */ + public String cknSecretIdentifier() { + return this.cknSecretIdentifier; + } + + /** + * Set the cknSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CKN key. + * + * @param cknSecretIdentifier the cknSecretIdentifier value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCknSecretIdentifier(String cknSecretIdentifier) { + this.cknSecretIdentifier = cknSecretIdentifier; + return this; + } + + /** + * Get the cakSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CAK key. + * + * @return the cakSecretIdentifier value. + */ + public String cakSecretIdentifier() { + return this.cakSecretIdentifier; + } + + /** + * Set the cakSecretIdentifier property: Keyvault Secret Identifier URL containing Mac security CAK key. + * + * @param cakSecretIdentifier the cakSecretIdentifier value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCakSecretIdentifier(String cakSecretIdentifier) { + this.cakSecretIdentifier = cakSecretIdentifier; + return this; + } + + /** + * Get the cipher property: Mac security cipher. + * + * @return the cipher value. + */ + public ExpressRouteLinkMacSecCipher cipher() { + return this.cipher; + } + + /** + * Set the cipher property: Mac security cipher. + * + * @param cipher the cipher value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withCipher(ExpressRouteLinkMacSecCipher cipher) { + this.cipher = cipher; + return this; + } + + /** + * Get the sciState property: Sci mode enabled/disabled. + * + * @return the sciState value. + */ + public ExpressRouteLinkMacSecSciState sciState() { + return this.sciState; + } + + /** + * Set the sciState property: Sci mode enabled/disabled. + * + * @param sciState the sciState value to set. + * @return the ExpressRouteLinkMacSecConfig object itself. + */ + public ExpressRouteLinkMacSecConfig withSciState(ExpressRouteLinkMacSecSciState sciState) { + this.sciState = sciState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java new file mode 100644 index 0000000000000..5930d7e7d0bf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteLinkMacSecSciState. */ +public final class ExpressRouteLinkMacSecSciState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRouteLinkMacSecSciState. */ + public static final ExpressRouteLinkMacSecSciState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRouteLinkMacSecSciState. */ + public static final ExpressRouteLinkMacSecSciState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRouteLinkMacSecSciState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecSciState. + */ + @JsonCreator + public static ExpressRouteLinkMacSecSciState fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecSciState.class); + } + + /** @return known ExpressRouteLinkMacSecSciState values. */ + public static Collection values() { + return values(ExpressRouteLinkMacSecSciState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java new file mode 100644 index 0000000000000..6a74589e59b5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteLinks. */ +public interface ExpressRouteLinks { + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink. + */ + ExpressRouteLink get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * Retrieves the specified ExpressRouteLink resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param linkName The name of the ExpressRouteLink resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String expressRoutePortName, String linkName, Context context); + + /** + * Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink List Result. + */ + 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. + */ + PagedIterable list(String resourceGroupName, String expressRoutePortName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java new file mode 100644 index 0000000000000..08bb4ee329753 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePeeringState. */ +public final class ExpressRoutePeeringState extends ExpandableStringEnum { + /** Static value Disabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState DISABLED = fromString("Disabled"); + + /** Static value Enabled for ExpressRoutePeeringState. */ + public static final ExpressRoutePeeringState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringState. + */ + @JsonCreator + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** @return known ExpressRoutePeeringState values. */ + public static Collection values() { + return values(ExpressRoutePeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java new file mode 100644 index 0000000000000..b5e9954a14fbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePeeringType. */ +public final class ExpressRoutePeeringType extends ExpandableStringEnum { + /** Static value AzurePublicPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PUBLIC_PEERING = fromString("AzurePublicPeering"); + + /** Static value AzurePrivatePeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType AZURE_PRIVATE_PEERING = fromString("AzurePrivatePeering"); + + /** Static value MicrosoftPeering for ExpressRoutePeeringType. */ + public static final ExpressRoutePeeringType MICROSOFT_PEERING = fromString("MicrosoftPeering"); + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringType. + */ + @JsonCreator + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** @return known ExpressRoutePeeringType values. */ + public static Collection values() { + return values(ExpressRoutePeeringType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java new file mode 100644 index 0000000000000..5b314514707e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner object. + * + * @return the inner object. + */ + ExpressRoutePortInner innerModel(); + + /** The entirety of the ExpressRoutePort definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ExpressRoutePort definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRoutePort definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ExpressRoutePort definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ExpressRoutePort definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ExpressRoutePort definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithPeeringLocation, + DefinitionStages.WithBandwidthInGbps, + DefinitionStages.WithEncapsulation, + DefinitionStages.WithLinks { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRoutePort create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRoutePort create(Context context); + } + /** The stage of the ExpressRoutePort definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ExpressRoutePort definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of ExpressRoutePort, if configured.. + * + * @param identity The identity of ExpressRoutePort, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the ExpressRoutePort definition allowing to specify peeringLocation. */ + interface WithPeeringLocation { + /** + * Specifies the peeringLocation property: The name of the peering location that the ExpressRoutePort is + * mapped to physically.. + * + * @param peeringLocation The name of the peering location that the ExpressRoutePort is mapped to + * physically. + * @return the next definition stage. + */ + WithCreate withPeeringLocation(String peeringLocation); + } + /** The stage of the ExpressRoutePort definition allowing to specify bandwidthInGbps. */ + interface WithBandwidthInGbps { + /** + * Specifies the bandwidthInGbps property: Bandwidth of procured ports in Gbps.. + * + * @param bandwidthInGbps Bandwidth of procured ports in Gbps. + * @return the next definition stage. + */ + WithCreate withBandwidthInGbps(Integer bandwidthInGbps); + } + /** The stage of the ExpressRoutePort definition allowing to specify encapsulation. */ + interface WithEncapsulation { + /** + * Specifies the encapsulation property: Encapsulation method on physical ports.. + * + * @param encapsulation Encapsulation method on physical ports. + * @return the next definition stage. + */ + WithCreate withEncapsulation(ExpressRoutePortsEncapsulation encapsulation); + } + /** The stage of the ExpressRoutePort definition allowing to specify links. */ + interface WithLinks { + /** + * Specifies the links property: 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); + } + } + /** + * 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..0fa672eac71ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorization.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.management.SubResource; +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 circuit property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuit value. + */ + SubResource circuit(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.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..189568e668d4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortAuthorizationListResult.class); + + /* + * 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; + + /** + * 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..bbab5fd3424a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePortAuthorizationUseStatus. */ +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 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); + } + + /** @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..5fa6390e64dcd --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 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 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. + */ + 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. + */ + 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..bc565e968d502 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoute Port List Result Response for ListExpressRoutePorts API service call. */ +@Fluent +public final class ExpressRoutePortListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortListResult.class); + + /* + * A list of ExpressRoutePort resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRoutePort resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRoutePort resources. + * + * @param value the value value to set. + * @return the ExpressRoutePortListResult object itself. + */ + public ExpressRoutePortListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRoutePortListResult object itself. + */ + public ExpressRoutePortListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java new file mode 100644 index 0000000000000..143d81f088e89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRoutePorts. */ +public interface ExpressRoutePorts { + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Deletes the specified ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the ExpressRoutePort resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String expressRoutePortName, Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port. + */ + ExpressRoutePort getByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String expressRoutePortName, Context context); + + /** + * List all the ExpressRoutePort resources in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port List Result. + */ + 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. + */ + 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. + */ + 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. + */ + PagedIterable list(Context context); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call. + */ + GenerateExpressRoutePortsLoaResult generateLoa( + String resourceGroupName, String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request); + + /** + * Generate a letter of authorization for the requested ExpressRoutePort resource. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of ExpressRoutePort. + * @param request Request parameters supplied to generate a letter of authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GenerateExpressRoutePortsLOA API service call along with {@link Response}. + */ + Response generateLoaWithResponse( + String resourceGroupName, + String expressRoutePortName, + GenerateExpressRoutePortsLoaRequest request, + Context context); + + /** + * Retrieves the requested ExpressRoutePort resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/ExpressRoutePortsEncapsulation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java new file mode 100644 index 0000000000000..529fec434dfc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRoutePortsEncapsulation. */ +public final class ExpressRoutePortsEncapsulation extends ExpandableStringEnum { + /** Static value Dot1Q for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation DOT1Q = fromString("Dot1Q"); + + /** Static value QinQ for ExpressRoutePortsEncapsulation. */ + public static final ExpressRoutePortsEncapsulation QINQ = fromString("QinQ"); + + /** + * Creates or finds a ExpressRoutePortsEncapsulation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePortsEncapsulation. + */ + @JsonCreator + public static ExpressRoutePortsEncapsulation fromString(String name) { + return fromString(name, ExpressRoutePortsEncapsulation.class); + } + + /** @return known ExpressRoutePortsEncapsulation values. */ + public static Collection values() { + return values(ExpressRoutePortsEncapsulation.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.java new file mode 100644 index 0000000000000..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..a1fa1443bd52a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoutePorts Location Bandwidths Real-time inventory of available ExpressRoute port bandwidths. */ +@Immutable +public final class ExpressRoutePortsLocationBandwidths { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationBandwidths.class); + + /* + * Bandwidth descriptive name. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /* + * Bandwidth value in Gbps. + */ + @JsonProperty(value = "valueInGbps", access = JsonProperty.Access.WRITE_ONLY) + private Integer valueInGbps; + + /** + * Get the offerName property: Bandwidth descriptive name. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Get the valueInGbps property: Bandwidth value in Gbps. + * + * @return the valueInGbps value. + */ + public Integer valueInGbps() { + return this.valueInGbps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java new file mode 100644 index 0000000000000..9b6bc1b763f6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ExpressRoutePorts Location List Result Response for ListExpressRoutePortsLocations API service call. */ +@Fluent +public final class ExpressRoutePortsLocationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRoutePortsLocationListResult.class); + + /* + * The list of all ExpressRoutePort peering locations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of all ExpressRoutePort peering locations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of all ExpressRoutePort peering locations. + * + * @param value the value value to set. + * @return the ExpressRoutePortsLocationListResult object itself. + */ + public ExpressRoutePortsLocationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRoutePortsLocationListResult object itself. + */ + public ExpressRoutePortsLocationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.java new file mode 100644 index 0000000000000..52b72bb5716d9 --- /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. + */ + 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. + */ + PagedIterable list(Context context); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location. + */ + ExpressRoutePortsLocation get(String locationName); + + /** + * Retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at + * said peering location. + * + * @param locationName Name of the requested ExpressRoutePort peering location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location along with {@link Response}. + */ + Response getWithResponse(String locationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.java new file mode 100644 index 0000000000000..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..742467efbc5f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains bandwidths offered in ExpressRouteServiceProvider resources. */ +@Fluent +public final class ExpressRouteServiceProviderBandwidthsOffered { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderBandwidthsOffered.class); + + /* + * The OfferName. + */ + @JsonProperty(value = "offerName") + private String offerName; + + /* + * The ValueInMbps. + */ + @JsonProperty(value = "valueInMbps") + private Integer valueInMbps; + + /** + * Get the offerName property: The OfferName. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Set the offerName property: The OfferName. + * + * @param offerName the offerName value to set. + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withOfferName(String offerName) { + this.offerName = offerName; + return this; + } + + /** + * Get the valueInMbps property: The ValueInMbps. + * + * @return the valueInMbps value. + */ + public Integer valueInMbps() { + return this.valueInMbps; + } + + /** + * Set the valueInMbps property: The ValueInMbps. + * + * @param valueInMbps the valueInMbps value to set. + * @return the ExpressRouteServiceProviderBandwidthsOffered object itself. + */ + public ExpressRouteServiceProviderBandwidthsOffered withValueInMbps(Integer valueInMbps) { + this.valueInMbps = valueInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java new file mode 100644 index 0000000000000..7d4b031dca8ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListExpressRouteServiceProvider API service call. */ +@Fluent +public final class ExpressRouteServiceProviderListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteServiceProviderListResult.class); + + /* + * A list of ExpressRouteResourceProvider resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of ExpressRouteResourceProvider resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteResourceProvider resources. + * + * @param value the value value to set. + * @return the ExpressRouteServiceProviderListResult object itself. + */ + public ExpressRouteServiceProviderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ExpressRouteServiceProviderListResult object itself. + */ + public ExpressRouteServiceProviderListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java new file mode 100644 index 0000000000000..88602f86e5522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ExpressRouteServiceProviders. */ +public interface ExpressRouteServiceProviders { + /** + * Gets all the available express route service providers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + PagedIterable list(); + + /** + * Gets all the available express route service providers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the available express route service providers. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..188b68168608f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExtendedLocation complex type. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..6a9fa9df2b881 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @return known ExtendedLocationTypes values. */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..78e080aa7b3d3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FilterItems.class); + + /* + * 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; + + /** + * 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..0389975d30aab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FirewallPolicies. */ +public interface FirewallPolicies { + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Deletes the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy. + */ + FirewallPolicy getByResourceGroup(String resourceGroupName, String firewallPolicyName); + + /** + * Gets the specified Firewall Policy. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String firewallPolicyName, String expand, Context context); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Firewall Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Firewall Policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Firewall Policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Firewall Policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Firewall Policy 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..0594f172079ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 explicitProxySettings property: Explicit Proxy Settings definition. + * + * @return the explicitProxySettings value. + */ + ExplicitProxySettings explicitProxySettings(); + + /** + * 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 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.WithExplicitProxySettings, + 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 explicitProxySettings. */ + interface WithExplicitProxySettings { + /** + * Specifies the explicitProxySettings property: Explicit Proxy Settings definition.. + * + * @param explicitProxySettings Explicit Proxy Settings definition. + * @return the next definition stage. + */ + WithCreate withExplicitProxySettings(ExplicitProxySettings explicitProxySettings); + } + /** The stage of the FirewallPolicy definition allowing to specify intrusionDetection. */ + interface WithIntrusionDetection { + /** + * Specifies the intrusionDetection property: The configuration for Intrusion detection.. + * + * @param intrusionDetection The configuration for Intrusion detection. + * @return the next definition stage. + */ + WithCreate withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection); + } + /** The stage of the FirewallPolicy definition allowing to specify transportSecurity. */ + interface WithTransportSecurity { + /** + * Specifies the transportSecurity property: TLS Configuration definition.. + * + * @param transportSecurity TLS Configuration definition. + * @return the next definition stage. + */ + WithCreate withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity); + } + /** The stage of the FirewallPolicy definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Firewall Policy SKU.. + * + * @param sku The Firewall Policy SKU. + * @return the next definition stage. + */ + WithCreate withSku(FirewallPolicySku sku); + } + } + /** + * Begins update for the FirewallPolicy resource. + * + * @return the stage of resource update. + */ + FirewallPolicy.Update update(); + + /** The template for FirewallPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithBasePolicy, + UpdateStages.WithThreatIntelMode, + UpdateStages.WithThreatIntelWhitelist, + UpdateStages.WithInsights, + UpdateStages.WithSnat, + UpdateStages.WithSql, + UpdateStages.WithDnsSettings, + UpdateStages.WithExplicitProxySettings, + UpdateStages.WithIntrusionDetection, + UpdateStages.WithTransportSecurity, + UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FirewallPolicy apply(Context context); + } + /** The FirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the FirewallPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the FirewallPolicy update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the firewall policy.. + * + * @param identity The identity of the firewall policy. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the FirewallPolicy update allowing to specify basePolicy. */ + interface WithBasePolicy { + /** + * Specifies the basePolicy property: The parent firewall policy from which rules are inherited.. + * + * @param basePolicy The parent firewall policy from which rules are inherited. + * @return the next definition stage. + */ + Update withBasePolicy(SubResource basePolicy); + } + /** The stage of the FirewallPolicy update allowing to specify threatIntelMode. */ + interface WithThreatIntelMode { + /** + * Specifies the threatIntelMode property: The operation mode for Threat Intelligence.. + * + * @param threatIntelMode The operation mode for Threat Intelligence. + * @return the next definition stage. + */ + Update withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode); + } + /** The stage of the FirewallPolicy update allowing to specify threatIntelWhitelist. */ + interface WithThreatIntelWhitelist { + /** + * Specifies the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy.. + * + * @param threatIntelWhitelist ThreatIntel Whitelist for Firewall Policy. + * @return the next definition stage. + */ + Update withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist); + } + /** The stage of the FirewallPolicy update allowing to specify insights. */ + interface WithInsights { + /** + * Specifies the insights property: Insights on Firewall Policy.. + * + * @param insights Insights on Firewall Policy. + * @return the next definition stage. + */ + Update withInsights(FirewallPolicyInsights insights); + } + /** The stage of the FirewallPolicy update allowing to specify snat. */ + interface WithSnat { + /** + * Specifies the snat property: The private IP addresses/IP ranges to which traffic will not be SNAT.. + * + * @param snat The private IP addresses/IP ranges to which traffic will not be SNAT. + * @return the next definition stage. + */ + Update withSnat(FirewallPolicySnat snat); + } + /** The stage of the FirewallPolicy update allowing to specify sql. */ + interface WithSql { + /** + * Specifies the sql property: SQL Settings definition.. + * + * @param sql SQL Settings definition. + * @return the next definition stage. + */ + Update withSql(FirewallPolicySql sql); + } + /** The stage of the FirewallPolicy update allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: DNS Proxy Settings definition.. + * + * @param dnsSettings DNS Proxy Settings definition. + * @return the next definition stage. + */ + Update withDnsSettings(DnsSettings dnsSettings); + } + /** The stage of the FirewallPolicy update allowing to specify explicitProxySettings. */ + interface WithExplicitProxySettings { + /** + * Specifies the explicitProxySettings property: Explicit Proxy Settings definition.. + * + * @param explicitProxySettings Explicit Proxy Settings definition. + * @return the next definition stage. + */ + Update withExplicitProxySettings(ExplicitProxySettings explicitProxySettings); + } + /** The stage of the FirewallPolicy update allowing to specify intrusionDetection. */ + interface WithIntrusionDetection { + /** + * Specifies the intrusionDetection property: The configuration for Intrusion detection.. + * + * @param intrusionDetection The configuration for Intrusion detection. + * @return the next definition stage. + */ + Update withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection); + } + /** The stage of the FirewallPolicy update allowing to specify transportSecurity. */ + interface WithTransportSecurity { + /** + * Specifies the transportSecurity property: TLS Configuration definition.. + * + * @param transportSecurity TLS Configuration definition. + * @return the next definition stage. + */ + Update withTransportSecurity(FirewallPolicyTransportSecurity transportSecurity); + } + /** The stage of the FirewallPolicy update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Firewall Policy SKU.. + * + * @param sku The Firewall Policy SKU. + * @return the next definition stage. + */ + Update withSku(FirewallPolicySku sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FirewallPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java new file mode 100644 index 0000000000000..ba8348b2a4133 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trusted Root certificates properties for tls. */ +@Fluent +public final class FirewallPolicyCertificateAuthority { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyCertificateAuthority.class); + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /* + * Name of the CA certificate. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @return the keyVaultSecretId value. + */ + public String keyVaultSecretId() { + return this.keyVaultSecretId; + } + + /** + * Set the keyVaultSecretId property: Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' + * object stored in KeyVault. + * + * @param keyVaultSecretId the keyVaultSecretId value to set. + * @return the FirewallPolicyCertificateAuthority object itself. + */ + public FirewallPolicyCertificateAuthority withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Get the name property: Name of the CA certificate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the CA certificate. + * + * @param name the name value to set. + * @return the FirewallPolicyCertificateAuthority object itself. + */ + public FirewallPolicyCertificateAuthority withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java new file mode 100644 index 0000000000000..a853c8bc09c19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Firewall Policy Filter Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyFilterRuleCollection") +@Fluent +public final class FirewallPolicyFilterRuleCollection extends FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyFilterRuleCollection.class); + + /* + * The action type of a Filter rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyFilterRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the action property: The action type of a Filter rule collection. + * + * @return the action value. + */ + public FirewallPolicyFilterRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Filter rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withAction(FirewallPolicyFilterRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyFilterRuleCollection object itself. + */ + public FirewallPolicyFilterRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyFilterRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java new file mode 100644 index 0000000000000..45f26950c7499 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the FirewallPolicyFilterRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyFilterRuleCollectionAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyFilterRuleCollectionAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private FirewallPolicyFilterRuleCollectionActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public FirewallPolicyFilterRuleCollectionActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the FirewallPolicyFilterRuleCollectionAction object itself. + */ + public FirewallPolicyFilterRuleCollectionAction withType(FirewallPolicyFilterRuleCollectionActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java new file mode 100644 index 0000000000000..3ebc9e9cc14da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyFilterRuleCollectionActionType. */ +public final class FirewallPolicyFilterRuleCollectionActionType + extends ExpandableStringEnum { + /** Static value Allow for FirewallPolicyFilterRuleCollectionActionType. */ + public static final FirewallPolicyFilterRuleCollectionActionType ALLOW = fromString("Allow"); + + /** Static value Deny for FirewallPolicyFilterRuleCollectionActionType. */ + public static final FirewallPolicyFilterRuleCollectionActionType DENY = fromString("Deny"); + + /** + * Creates or finds a FirewallPolicyFilterRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyFilterRuleCollectionActionType. + */ + @JsonCreator + public static FirewallPolicyFilterRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyFilterRuleCollectionActionType.class); + } + + /** @return known FirewallPolicyFilterRuleCollectionActionType values. */ + public static Collection values() { + return values(FirewallPolicyFilterRuleCollectionActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..3f9b00ccc1896 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..b9e734f15ecdb --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..e78e2ae3886f0 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 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 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); + + /** + * 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); + + /** + * 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 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 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); + + /** + * 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); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java new file mode 100644 index 0000000000000..1907ab78a1214 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyInsights { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyInsights.class); + + /* + * A flag to indicate if the insights are enabled on the policy. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Number of days the insights should be enabled on the policy. + */ + @JsonProperty(value = "retentionDays") + private Integer retentionDays; + + /* + * Workspaces needed to configure the Firewall Policy Insights. + */ + @JsonProperty(value = "logAnalyticsResources") + private FirewallPolicyLogAnalyticsResources logAnalyticsResources; + + /** + * Get the isEnabled property: A flag to indicate if the insights are enabled on the policy. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: A flag to indicate if the insights are enabled on the policy. + * + * @param isEnabled the isEnabled value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the retentionDays property: Number of days the insights should be enabled on the policy. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: Number of days the insights should be enabled on the policy. + * + * @param retentionDays the retentionDays value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the logAnalyticsResources property: Workspaces needed to configure the Firewall Policy Insights. + * + * @return the logAnalyticsResources value. + */ + public FirewallPolicyLogAnalyticsResources logAnalyticsResources() { + return this.logAnalyticsResources; + } + + /** + * Set the logAnalyticsResources property: Workspaces needed to configure the Firewall Policy Insights. + * + * @param logAnalyticsResources the logAnalyticsResources value to set. + * @return the FirewallPolicyInsights object itself. + */ + public FirewallPolicyInsights withLogAnalyticsResources(FirewallPolicyLogAnalyticsResources logAnalyticsResources) { + this.logAnalyticsResources = logAnalyticsResources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalyticsResources() != null) { + logAnalyticsResources().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java new file mode 100644 index 0000000000000..9f83cad2b9362 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for intrusion detection mode and rules. */ +@Fluent +public final class FirewallPolicyIntrusionDetection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetection.class); + + /* + * Intrusion detection general state. + */ + @JsonProperty(value = "mode") + private FirewallPolicyIntrusionDetectionStateType mode; + + /* + * Intrusion detection configuration properties. + */ + @JsonProperty(value = "configuration") + private FirewallPolicyIntrusionDetectionConfiguration configuration; + + /** + * Get the mode property: Intrusion detection general state. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: Intrusion detection general state. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withMode(FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Get the configuration property: Intrusion detection configuration properties. + * + * @return the configuration value. + */ + public FirewallPolicyIntrusionDetectionConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Intrusion detection configuration properties. + * + * @param configuration the configuration value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withConfiguration( + FirewallPolicyIntrusionDetectionConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java new file mode 100644 index 0000000000000..d8b4925787346 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Intrusion detection bypass traffic specification. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.class); + + /* + * Name of the bypass traffic rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the bypass traffic rule. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The rule bypass protocol. + */ + @JsonProperty(value = "protocol") + private FirewallPolicyIntrusionDetectionProtocol protocol; + + /* + * List of source IP addresses or ranges for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or ranges for this rule. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports or ranges. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /** + * Get the name property: Name of the bypass traffic rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the bypass traffic rule. + * + * @param name the name value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the bypass traffic rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the bypass traffic rule. + * + * @param description the description value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: The rule bypass protocol. + * + * @return the protocol value. + */ + public FirewallPolicyIntrusionDetectionProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The rule bypass protocol. + * + * @param protocol the protocol value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withProtocol( + FirewallPolicyIntrusionDetectionProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses or ranges for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses or ranges for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withSourceAddresses( + List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or ranges for this rule. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or ranges for this rule. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationAddresses( + List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports or ranges. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports or ranges. + * + * @param destinationPorts the destinationPorts value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationPorts( + List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the FirewallPolicyIntrusionDetectionBypassTrafficSpecifications object itself. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications withDestinationIpGroups( + List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java new file mode 100644 index 0000000000000..a9c7a68db75ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The operation for configuring intrusion detection. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetectionConfiguration.class); + + /* + * List of specific signatures states. + */ + @JsonProperty(value = "signatureOverrides") + private List signatureOverrides; + + /* + * List of rules for traffic to bypass. + */ + @JsonProperty(value = "bypassTrafficSettings") + private List bypassTrafficSettings; + + /** + * Get the signatureOverrides property: List of specific signatures states. + * + * @return the signatureOverrides value. + */ + public List signatureOverrides() { + return this.signatureOverrides; + } + + /** + * Set the signatureOverrides property: List of specific signatures states. + * + * @param signatureOverrides the signatureOverrides value to set. + * @return the FirewallPolicyIntrusionDetectionConfiguration object itself. + */ + public FirewallPolicyIntrusionDetectionConfiguration withSignatureOverrides( + List signatureOverrides) { + this.signatureOverrides = signatureOverrides; + return this; + } + + /** + * Get the bypassTrafficSettings property: List of rules for traffic to bypass. + * + * @return the bypassTrafficSettings value. + */ + public List bypassTrafficSettings() { + return this.bypassTrafficSettings; + } + + /** + * Set the bypassTrafficSettings property: List of rules for traffic to bypass. + * + * @param bypassTrafficSettings the bypassTrafficSettings value to set. + * @return the FirewallPolicyIntrusionDetectionConfiguration object itself. + */ + public FirewallPolicyIntrusionDetectionConfiguration withBypassTrafficSettings( + List bypassTrafficSettings) { + this.bypassTrafficSettings = bypassTrafficSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signatureOverrides() != null) { + signatureOverrides().forEach(e -> e.validate()); + } + if (bypassTrafficSettings() != null) { + bypassTrafficSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java new file mode 100644 index 0000000000000..ad1e1c3187129 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyIntrusionDetectionProtocol. */ +public final class FirewallPolicyIntrusionDetectionProtocol + extends ExpandableStringEnum { + /** Static value TCP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol TCP = fromString("TCP"); + + /** Static value UDP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol UDP = fromString("UDP"); + + /** Static value ICMP for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol ICMP = fromString("ICMP"); + + /** Static value ANY for FirewallPolicyIntrusionDetectionProtocol. */ + public static final FirewallPolicyIntrusionDetectionProtocol ANY = fromString("ANY"); + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionProtocol. + */ + @JsonCreator + public static FirewallPolicyIntrusionDetectionProtocol fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionProtocol.class); + } + + /** @return known FirewallPolicyIntrusionDetectionProtocol values. */ + public static Collection values() { + return values(FirewallPolicyIntrusionDetectionProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java new file mode 100644 index 0000000000000..575aee0649175 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Intrusion detection signatures specification states. */ +@Fluent +public final class FirewallPolicyIntrusionDetectionSignatureSpecification { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(FirewallPolicyIntrusionDetectionSignatureSpecification.class); + + /* + * Signature id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The signature state. + */ + @JsonProperty(value = "mode") + private FirewallPolicyIntrusionDetectionStateType mode; + + /** + * Get the id property: Signature id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Signature id. + * + * @param id the id value to set. + * @return the FirewallPolicyIntrusionDetectionSignatureSpecification object itself. + */ + public FirewallPolicyIntrusionDetectionSignatureSpecification withId(String id) { + this.id = id; + return this; + } + + /** + * Get the mode property: The signature state. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: The signature state. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetectionSignatureSpecification object itself. + */ + public FirewallPolicyIntrusionDetectionSignatureSpecification withMode( + FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java new file mode 100644 index 0000000000000..f8b0a0899843d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyIntrusionDetectionStateType. */ +public final class FirewallPolicyIntrusionDetectionStateType + extends ExpandableStringEnum { + /** Static value Off for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType OFF = fromString("Off"); + + /** Static value Alert for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType ALERT = fromString("Alert"); + + /** Static value Deny for FirewallPolicyIntrusionDetectionStateType. */ + public static final FirewallPolicyIntrusionDetectionStateType DENY = fromString("Deny"); + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionStateType. + */ + @JsonCreator + public static FirewallPolicyIntrusionDetectionStateType fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionStateType.class); + } + + /** @return known FirewallPolicyIntrusionDetectionStateType values. */ + public static Collection values() { + return values(FirewallPolicyIntrusionDetectionStateType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java new file mode 100644 index 0000000000000..7aab8d1099c0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicies API service call. */ +@Fluent +public final class FirewallPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyListResult.class); + + /* + * List of Firewall Policies in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Firewall Policies in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Firewall Policies in a resource group. + * + * @param value the value value to set. + * @return the FirewallPolicyListResult object itself. + */ + public FirewallPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the FirewallPolicyListResult object itself. + */ + public FirewallPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java new file mode 100644 index 0000000000000..e6bffa80b0fdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Log Analytics Resources for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyLogAnalyticsResources.class); + + /* + * List of workspaces for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaces") + private List workspaces; + + /* + * The default workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "defaultWorkspaceId") + private SubResource defaultWorkspaceId; + + /** + * Get the workspaces property: List of workspaces for Firewall Policy Insights. + * + * @return the workspaces value. + */ + public List workspaces() { + return this.workspaces; + } + + /** + * Set the workspaces property: List of workspaces for Firewall Policy Insights. + * + * @param workspaces the workspaces value to set. + * @return the FirewallPolicyLogAnalyticsResources object itself. + */ + public FirewallPolicyLogAnalyticsResources withWorkspaces(List workspaces) { + this.workspaces = workspaces; + return this; + } + + /** + * Get the defaultWorkspaceId property: The default workspace Id for Firewall Policy Insights. + * + * @return the defaultWorkspaceId value. + */ + public SubResource defaultWorkspaceId() { + return this.defaultWorkspaceId; + } + + /** + * Set the defaultWorkspaceId property: The default workspace Id for Firewall Policy Insights. + * + * @param defaultWorkspaceId the defaultWorkspaceId value to set. + * @return the FirewallPolicyLogAnalyticsResources object itself. + */ + public FirewallPolicyLogAnalyticsResources withDefaultWorkspaceId(SubResource defaultWorkspaceId) { + this.defaultWorkspaceId = defaultWorkspaceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (workspaces() != null) { + workspaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java new file mode 100644 index 0000000000000..1c0b5b3d1da10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log Analytics Workspace for Firewall Policy Insights. */ +@Fluent +public final class FirewallPolicyLogAnalyticsWorkspace { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyLogAnalyticsWorkspace.class); + + /* + * Region to configure the Workspace. + */ + @JsonProperty(value = "region") + private String region; + + /* + * The workspace Id for Firewall Policy Insights. + */ + @JsonProperty(value = "workspaceId") + private SubResource workspaceId; + + /** + * Get the region property: Region to configure the Workspace. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region to configure the Workspace. + * + * @param region the region value to set. + * @return the FirewallPolicyLogAnalyticsWorkspace object itself. + */ + public FirewallPolicyLogAnalyticsWorkspace withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the workspaceId property: The workspace Id for Firewall Policy Insights. + * + * @return the workspaceId value. + */ + public SubResource workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace Id for Firewall Policy Insights. + * + * @param workspaceId the workspaceId value to set. + * @return the FirewallPolicyLogAnalyticsWorkspace object itself. + */ + public FirewallPolicyLogAnalyticsWorkspace withWorkspaceId(SubResource workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java new file mode 100644 index 0000000000000..22452d7a6a4ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Firewall Policy NAT Rule Collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleCollectionType") +@JsonTypeName("FirewallPolicyNatRuleCollection") +@Fluent +public final class FirewallPolicyNatRuleCollection extends FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyNatRuleCollection.class); + + /* + * The action type of a Nat rule collection. + */ + @JsonProperty(value = "action") + private FirewallPolicyNatRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the action property: The action type of a Nat rule collection. + * + * @return the action value. + */ + public FirewallPolicyNatRuleCollectionAction action() { + return this.action; + } + + /** + * Set the action property: The action type of a Nat rule collection. + * + * @param action the action value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withAction(FirewallPolicyNatRuleCollectionAction action) { + this.action = action; + return this; + } + + /** + * Get the rules property: List of rules included in a rule collection. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules included in a rule collection. + * + * @param rules the rules value to set. + * @return the FirewallPolicyNatRuleCollection object itself. + */ + public FirewallPolicyNatRuleCollection withRules(List rules) { + this.rules = rules; + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public FirewallPolicyNatRuleCollection withPriority(Integer priority) { + super.withPriority(priority); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java new file mode 100644 index 0000000000000..4565ab2c1be50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the FirewallPolicyNatRuleCollectionAction. */ +@Fluent +public final class FirewallPolicyNatRuleCollectionAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyNatRuleCollectionAction.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private FirewallPolicyNatRuleCollectionActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public FirewallPolicyNatRuleCollectionActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the FirewallPolicyNatRuleCollectionAction object itself. + */ + public FirewallPolicyNatRuleCollectionAction withType(FirewallPolicyNatRuleCollectionActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java new file mode 100644 index 0000000000000..4e881dede417f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyNatRuleCollectionActionType. */ +public final class FirewallPolicyNatRuleCollectionActionType + extends ExpandableStringEnum { + /** Static value DNAT for FirewallPolicyNatRuleCollectionActionType. */ + public static final FirewallPolicyNatRuleCollectionActionType DNAT = fromString("DNAT"); + + /** + * Creates or finds a FirewallPolicyNatRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyNatRuleCollectionActionType. + */ + @JsonCreator + public static FirewallPolicyNatRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyNatRuleCollectionActionType.class); + } + + /** @return known FirewallPolicyNatRuleCollectionActionType values. */ + public static Collection values() { + return values(FirewallPolicyNatRuleCollectionActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java new file mode 100644 index 0000000000000..eab3c0fe34959 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleType", + defaultImpl = FirewallPolicyRule.class) +@JsonTypeName("FirewallPolicyRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ApplicationRule", value = ApplicationRule.class), + @JsonSubTypes.Type(name = "NatRule", value = NatRule.class), + @JsonSubTypes.Type(name = "NetworkRule", value = NetworkRule.class) +}) +@Fluent +public class FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRule.class); + + /* + * Name of the rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of the rule. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name property: Name of the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the rule. + * + * @param name the name value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of the rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the rule. + * + * @param description the description value to set. + * @return the FirewallPolicyRule object itself. + */ + public FirewallPolicyRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java new file mode 100644 index 0000000000000..040c7c27b1fe3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the application rule protocol. */ +@Fluent +public final class FirewallPolicyRuleApplicationProtocol { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleApplicationProtocol.class); + + /* + * Protocol type. + */ + @JsonProperty(value = "protocolType") + private FirewallPolicyRuleApplicationProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the protocolType property: Protocol type. + * + * @return the protocolType value. + */ + public FirewallPolicyRuleApplicationProtocolType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Protocol type. + * + * @param protocolType the protocolType value to set. + * @return the FirewallPolicyRuleApplicationProtocol object itself. + */ + public FirewallPolicyRuleApplicationProtocol withProtocolType( + FirewallPolicyRuleApplicationProtocolType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the port property: Port number for the protocol, cannot be greater than 64000. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port number for the protocol, cannot be greater than 64000. + * + * @param port the port value to set. + * @return the FirewallPolicyRuleApplicationProtocol object itself. + */ + public FirewallPolicyRuleApplicationProtocol withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java new file mode 100644 index 0000000000000..af558c3ea23bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleApplicationProtocolType. */ +public final class FirewallPolicyRuleApplicationProtocolType + extends ExpandableStringEnum { + /** Static value Http for FirewallPolicyRuleApplicationProtocolType. */ + public static final FirewallPolicyRuleApplicationProtocolType HTTP = fromString("Http"); + + /** Static value Https for FirewallPolicyRuleApplicationProtocolType. */ + public static final FirewallPolicyRuleApplicationProtocolType HTTPS = fromString("Https"); + + /** + * Creates or finds a FirewallPolicyRuleApplicationProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleApplicationProtocolType. + */ + @JsonCreator + public static FirewallPolicyRuleApplicationProtocolType fromString(String name) { + return fromString(name, FirewallPolicyRuleApplicationProtocolType.class); + } + + /** @return known FirewallPolicyRuleApplicationProtocolType values. */ + public static Collection values() { + return values(FirewallPolicyRuleApplicationProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java new file mode 100644 index 0000000000000..a9541ec85895a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of the rule collection. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleCollectionType", + defaultImpl = FirewallPolicyRuleCollection.class) +@JsonTypeName("FirewallPolicyRuleCollection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FirewallPolicyNatRuleCollection", value = FirewallPolicyNatRuleCollection.class), + @JsonSubTypes.Type(name = "FirewallPolicyFilterRuleCollection", value = FirewallPolicyFilterRuleCollection.class) +}) +@Fluent +public class FirewallPolicyRuleCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollection.class); + + /* + * The name of the rule collection. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Priority of the Firewall Policy Rule Collection resource. + */ + @JsonProperty(value = "priority") + private Integer priority; + + /** + * Get the name property: The name of the rule collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the rule collection. + * + * @param name the name value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withName(String name) { + this.name = name; + return this; + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the Firewall Policy Rule Collection resource. + * + * @param priority the priority value to set. + * @return the FirewallPolicyRuleCollection object itself. + */ + public FirewallPolicyRuleCollection withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java new file mode 100644 index 0000000000000..912ce5dd4d56e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import java.util.List; + +/** An immutable client-side representation of FirewallPolicyRuleCollectionGroup. */ +public interface FirewallPolicyRuleCollectionGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Rule Group type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + List ruleCollections(); + + /** + * Gets the provisioningState property: The provisioning state of the firewall policy rule collection group + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner + * object. + * + * @return the inner object. + */ + FirewallPolicyRuleCollectionGroupInner innerModel(); + + /** The entirety of the FirewallPolicyRuleCollectionGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FirewallPolicyRuleCollectionGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the FirewallPolicyRuleCollectionGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, firewallPolicyName. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @return the next definition stage. + */ + WithCreate withExistingFirewallPolicy(String resourceGroupName, String firewallPolicyName); + } + /** + * The stage of the FirewallPolicyRuleCollectionGroup definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, DefinitionStages.WithPriority, DefinitionStages.WithRuleCollections { + /** + * Executes the create request. + * + * @return the created resource. + */ + FirewallPolicyRuleCollectionGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FirewallPolicyRuleCollectionGroup create(Context context); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the Firewall Policy Rule Collection Group resource.. + * + * @param priority Priority of the Firewall Policy Rule Collection Group resource. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the FirewallPolicyRuleCollectionGroup definition allowing to specify ruleCollections. */ + interface WithRuleCollections { + /** + * Specifies the ruleCollections property: Group of Firewall Policy rule collections.. + * + * @param ruleCollections Group of Firewall Policy rule collections. + * @return the next definition stage. + */ + WithCreate withRuleCollections(List ruleCollections); + } + } + /** + * Begins update for the FirewallPolicyRuleCollectionGroup resource. + * + * @return the stage of resource update. + */ + FirewallPolicyRuleCollectionGroup.Update update(); + + /** The template for FirewallPolicyRuleCollectionGroup update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithPriority, UpdateStages.WithRuleCollections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FirewallPolicyRuleCollectionGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FirewallPolicyRuleCollectionGroup apply(Context context); + } + /** The FirewallPolicyRuleCollectionGroup update stages. */ + interface UpdateStages { + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: Priority of the Firewall Policy Rule Collection Group resource.. + * + * @param priority Priority of the Firewall Policy Rule Collection Group resource. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the FirewallPolicyRuleCollectionGroup update allowing to specify ruleCollections. */ + interface WithRuleCollections { + /** + * Specifies the ruleCollections property: Group of Firewall Policy rule collections.. + * + * @param ruleCollections Group of Firewall Policy rule collections. + * @return the next definition stage. + */ + Update withRuleCollections(List ruleCollections); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FirewallPolicyRuleCollectionGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FirewallPolicyRuleCollectionGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java new file mode 100644 index 0000000000000..f26033609d79d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFirewallPolicyRuleCollectionGroups API service call. */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyRuleCollectionGroupListResult.class); + + /* + * List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + * + * @param value the value value to set. + * @return the FirewallPolicyRuleCollectionGroupListResult object itself. + */ + public FirewallPolicyRuleCollectionGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the FirewallPolicyRuleCollectionGroupListResult object itself. + */ + public FirewallPolicyRuleCollectionGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java new file mode 100644 index 0000000000000..34c7be0ad5b0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FirewallPolicyRuleCollectionGroups. */ +public interface FirewallPolicyRuleCollectionGroups { + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName); + + /** + * Deletes the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup. + */ + FirewallPolicyRuleCollectionGroup get( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param ruleCollectionGroupName The name of the FirewallPolicyRuleCollectionGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + PagedIterable list(String resourceGroupName, String firewallPolicyName); + + /** + * Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call. + */ + PagedIterable list( + String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Gets the specified FirewallPolicyRuleCollectionGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified FirewallPolicyRuleCollectionGroup 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..b2c81ee4337c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleCollectionType. */ +public final class FirewallPolicyRuleCollectionType extends ExpandableStringEnum { + /** Static value FirewallPolicyNatRuleCollection for FirewallPolicyRuleCollectionType. */ + public static final FirewallPolicyRuleCollectionType FIREWALL_POLICY_NAT_RULE_COLLECTION = + fromString("FirewallPolicyNatRuleCollection"); + + /** Static value FirewallPolicyFilterRuleCollection for FirewallPolicyRuleCollectionType. */ + public static final FirewallPolicyRuleCollectionType FIREWALL_POLICY_FILTER_RULE_COLLECTION = + fromString("FirewallPolicyFilterRuleCollection"); + + /** + * Creates or finds a FirewallPolicyRuleCollectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleCollectionType. + */ + @JsonCreator + public static FirewallPolicyRuleCollectionType fromString(String name) { + return fromString(name, FirewallPolicyRuleCollectionType.class); + } + + /** @return known FirewallPolicyRuleCollectionType values. */ + public static Collection values() { + return values(FirewallPolicyRuleCollectionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java new file mode 100644 index 0000000000000..dbdaaf92e7b51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleNetworkProtocol. */ +public final class FirewallPolicyRuleNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol UDP = fromString("UDP"); + + /** Static value Any for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol ANY = fromString("Any"); + + /** Static value ICMP for FirewallPolicyRuleNetworkProtocol. */ + public static final FirewallPolicyRuleNetworkProtocol ICMP = fromString("ICMP"); + + /** + * Creates or finds a FirewallPolicyRuleNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleNetworkProtocol. + */ + @JsonCreator + public static FirewallPolicyRuleNetworkProtocol fromString(String name) { + return fromString(name, FirewallPolicyRuleNetworkProtocol.class); + } + + /** @return known FirewallPolicyRuleNetworkProtocol values. */ + public static Collection values() { + return values(FirewallPolicyRuleNetworkProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java new file mode 100644 index 0000000000000..fb37236dd31af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicyRuleType. */ +public final class FirewallPolicyRuleType extends ExpandableStringEnum { + /** Static value ApplicationRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType APPLICATION_RULE = fromString("ApplicationRule"); + + /** Static value NetworkRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType NETWORK_RULE = fromString("NetworkRule"); + + /** Static value NatRule for FirewallPolicyRuleType. */ + public static final FirewallPolicyRuleType NAT_RULE = fromString("NatRule"); + + /** + * Creates or finds a FirewallPolicyRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleType. + */ + @JsonCreator + public static FirewallPolicyRuleType fromString(String name) { + return fromString(name, FirewallPolicyRuleType.class); + } + + /** @return known FirewallPolicyRuleType values. */ + public static Collection values() { + return values(FirewallPolicyRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java new file mode 100644 index 0000000000000..ca143cb52d5b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of Firewall policy. */ +@Fluent +public final class FirewallPolicySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicySku.class); + + /* + * Tier of Firewall Policy. + */ + @JsonProperty(value = "tier") + private FirewallPolicySkuTier tier; + + /** + * Get the tier property: Tier of Firewall Policy. + * + * @return the tier value. + */ + public FirewallPolicySkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of Firewall Policy. + * + * @param tier the tier value to set. + * @return the FirewallPolicySku object itself. + */ + public FirewallPolicySku withTier(FirewallPolicySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java new file mode 100644 index 0000000000000..30e1ad28ff259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FirewallPolicySkuTier. */ +public final class FirewallPolicySkuTier extends ExpandableStringEnum { + /** Static value Standard for FirewallPolicySkuTier. */ + public static final FirewallPolicySkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for FirewallPolicySkuTier. */ + public static final FirewallPolicySkuTier PREMIUM = fromString("Premium"); + + /** Static value Basic for FirewallPolicySkuTier. */ + public static final FirewallPolicySkuTier BASIC = fromString("Basic"); + + /** + * Creates or finds a FirewallPolicySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicySkuTier. + */ + @JsonCreator + public static FirewallPolicySkuTier fromString(String name) { + return fromString(name, FirewallPolicySkuTier.class); + } + + /** @return known FirewallPolicySkuTier values. */ + public static Collection values() { + return values(FirewallPolicySkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java new file mode 100644 index 0000000000000..4a5b9f7ecf370 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private IP addresses/IP ranges to which traffic will not be SNAT. */ +@Fluent +public final class FirewallPolicySnat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicySnat.class); + + /* + * List of private IP addresses/IP address ranges to not be SNAT. + */ + @JsonProperty(value = "privateRanges") + private List privateRanges; + + /** + * Get the privateRanges property: List of private IP addresses/IP address ranges to not be SNAT. + * + * @return the privateRanges value. + */ + public List privateRanges() { + return this.privateRanges; + } + + /** + * Set the privateRanges property: List of private IP addresses/IP address ranges to not be SNAT. + * + * @param privateRanges the privateRanges value to set. + * @return the FirewallPolicySnat object itself. + */ + public FirewallPolicySnat withPrivateRanges(List privateRanges) { + this.privateRanges = privateRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..8223dbf7bd7ef --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SQL Settings in Firewall Policy. */ +@Fluent +public final class FirewallPolicySql { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicySql.class); + + /* + * 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; + + /** + * 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..7bec9e06250a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ThreatIntel Whitelist for Firewall Policy. */ +@Fluent +public final class FirewallPolicyThreatIntelWhitelist { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyThreatIntelWhitelist.class); + + /* + * List of IP addresses for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /* + * List of FQDNs for the ThreatIntel Whitelist. + */ + @JsonProperty(value = "fqdns") + private List fqdns; + + /** + * Get the ipAddresses property: List of IP addresses for the ThreatIntel Whitelist. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: List of IP addresses for the ThreatIntel Whitelist. + * + * @param ipAddresses the ipAddresses value to set. + * @return the FirewallPolicyThreatIntelWhitelist object itself. + */ + public FirewallPolicyThreatIntelWhitelist withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Get the fqdns property: List of FQDNs for the ThreatIntel Whitelist. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Set the fqdns property: List of FQDNs for the ThreatIntel Whitelist. + * + * @param fqdns the fqdns value to set. + * @return the FirewallPolicyThreatIntelWhitelist object itself. + */ + public FirewallPolicyThreatIntelWhitelist withFqdns(List fqdns) { + this.fqdns = fqdns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java new file mode 100644 index 0000000000000..1bb383f4ea914 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration needed to perform TLS termination & initiation. */ +@Fluent +public final class FirewallPolicyTransportSecurity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallPolicyTransportSecurity.class); + + /* + * The CA used for intermediate CA generation. + */ + @JsonProperty(value = "certificateAuthority") + private FirewallPolicyCertificateAuthority certificateAuthority; + + /** + * Get the certificateAuthority property: The CA used for intermediate CA generation. + * + * @return the certificateAuthority value. + */ + public FirewallPolicyCertificateAuthority certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: The CA used for intermediate CA generation. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the FirewallPolicyTransportSecurity object itself. + */ + public FirewallPolicyTransportSecurity withCertificateAuthority( + FirewallPolicyCertificateAuthority certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateAuthority() != null) { + certificateAuthority().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java new file mode 100644 index 0000000000000..00b3956875b21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import java.util.Map; + +/** An immutable client-side representation of FlowLog. */ +public interface FlowLog { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner object. + * + * @return the inner object. + */ + FlowLogInner innerModel(); + + /** The entirety of the FlowLog definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The FlowLog definition stages. */ + interface DefinitionStages { + /** The first stage of the FlowLog definition. */ + interface Blank extends WithLocation { + } + /** The stage of the FlowLog definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the FlowLog definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkWatcherName. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @return the next definition stage. + */ + WithCreate withExistingNetworkWatcher(String resourceGroupName, String networkWatcherName); + } + /** + * The stage of the FlowLog definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithTargetResourceId, + DefinitionStages.WithStorageId, + DefinitionStages.WithEnabled, + DefinitionStages.WithRetentionPolicy, + DefinitionStages.WithFormat, + DefinitionStages.WithFlowAnalyticsConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + FlowLog create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FlowLog create(Context context); + } + /** The stage of the FlowLog definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the FlowLog definition allowing to specify targetResourceId. */ + interface WithTargetResourceId { + /** + * Specifies the targetResourceId property: ID of network security group to which flow log will be applied.. + * + * @param targetResourceId ID of network security group to which flow log will be applied. + * @return the next definition stage. + */ + WithCreate withTargetResourceId(String targetResourceId); + } + /** The stage of the FlowLog definition allowing to specify storageId. */ + interface WithStorageId { + /** + * Specifies the storageId property: ID of the storage account which is used to store the flow log.. + * + * @param storageId ID of the storage account which is used to store the flow log. + * @return the next definition stage. + */ + WithCreate withStorageId(String storageId); + } + /** The stage of the FlowLog definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Flag to enable/disable flow logging.. + * + * @param enabled Flag to enable/disable flow logging. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + /** The stage of the FlowLog definition allowing to specify retentionPolicy. */ + interface WithRetentionPolicy { + /** + * Specifies the retentionPolicy property: Parameters that define the retention policy for flow log.. + * + * @param retentionPolicy Parameters that define the retention policy for flow log. + * @return the next definition stage. + */ + WithCreate withRetentionPolicy(RetentionPolicyParameters retentionPolicy); + } + /** The stage of the FlowLog definition allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Parameters that define the flow log format.. + * + * @param format Parameters that define the flow log format. + * @return the next definition stage. + */ + WithCreate withFormat(FlowLogFormatParameters format); + } + /** The stage of the FlowLog definition allowing to specify flowAnalyticsConfiguration. */ + interface WithFlowAnalyticsConfiguration { + /** + * Specifies the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics.. + * + * @param flowAnalyticsConfiguration Parameters that define the configuration of traffic analytics. + * @return the next definition stage. + */ + WithCreate withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration); + } + } + /** + * Begins update for the FlowLog resource. + * + * @return the stage of resource update. + */ + FlowLog.Update update(); + + /** The template for FlowLog update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FlowLog apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FlowLog apply(Context context); + } + /** The FlowLog update stages. */ + interface UpdateStages { + /** The stage of the FlowLog update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FlowLog refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FlowLog refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java new file mode 100644 index 0000000000000..54fbc9f528cf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the flow log format. */ +@Fluent +public final class FlowLogFormatParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogFormatParameters.class); + + /* + * The file type of flow log. + */ + @JsonProperty(value = "type") + private FlowLogFormatType type; + + /* + * The version (revision) of the flow log. + */ + @JsonProperty(value = "version") + private Integer version; + + /** + * Get the type property: The file type of flow log. + * + * @return the type value. + */ + public FlowLogFormatType type() { + return this.type; + } + + /** + * Set the type property: The file type of flow log. + * + * @param type the type value to set. + * @return the FlowLogFormatParameters object itself. + */ + public FlowLogFormatParameters withType(FlowLogFormatType type) { + this.type = type; + return this; + } + + /** + * Get the version property: The version (revision) of the flow log. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Set the version property: The version (revision) of the flow log. + * + * @param version the version value to set. + * @return the FlowLogFormatParameters object itself. + */ + public FlowLogFormatParameters withVersion(Integer version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java new file mode 100644 index 0000000000000..1818ba4200b38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FlowLogFormatType. */ +public final class FlowLogFormatType extends ExpandableStringEnum { + /** Static value JSON for FlowLogFormatType. */ + public static final FlowLogFormatType JSON = fromString("JSON"); + + /** + * Creates or finds a FlowLogFormatType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowLogFormatType. + */ + @JsonCreator + public static FlowLogFormatType fromString(String name) { + return fromString(name, FlowLogFormatType.class); + } + + /** @return known FlowLogFormatType values. */ + public static Collection values() { + return values(FlowLogFormatType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java new file mode 100644 index 0000000000000..7e1c0492935c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** An immutable client-side representation of FlowLogInformation. */ +public interface FlowLogInformation { + /** + * Gets the targetResourceId property: The ID of the resource to configure for flow log and traffic analytics + * (optional) . + * + * @return the targetResourceId value. + */ + String targetResourceId(); + + /** + * Gets the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + TrafficAnalyticsProperties flowAnalyticsConfiguration(); + + /** + * Gets the storageId property: ID of the storage account which is used to store the flow log. + * + * @return the storageId value. + */ + String storageId(); + + /** + * Gets the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + boolean enabled(); + + /** + * Gets the retentionPolicy property: Parameters that define the retention policy for flow log. + * + * @return the retentionPolicy value. + */ + RetentionPolicyParameters retentionPolicy(); + + /** + * Gets the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + FlowLogFormatParameters format(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner object. + * + * @return the inner object. + */ + FlowLogInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java new file mode 100644 index 0000000000000..f8d66564b371e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of flow logs. */ +@Fluent +public final class FlowLogListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogListResult.class); + + /* + * Information about flow log resource. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Information about flow log resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about flow log resource. + * + * @param value the value value to set. + * @return the FlowLogListResult object itself. + */ + public FlowLogListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java new file mode 100644 index 0000000000000..22762778cafe9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define a resource to query flow log and traffic analytics (optional) status. */ +@Fluent +public final class FlowLogStatusParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FlowLogStatusParameters.class); + + /* + * The target resource where getting the flow log and traffic analytics + * (optional) status. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: The target resource where getting the flow log and traffic analytics + * (optional) status. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The target resource where getting the flow log and traffic analytics + * (optional) status. + * + * @param targetResourceId the targetResourceId value to set. + * @return the FlowLogStatusParameters object itself. + */ + public FlowLogStatusParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogStatusParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java new file mode 100644 index 0000000000000..1b1d6c69b30fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FlowLogs. */ +public interface FlowLogs { + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name. + */ + FlowLog get(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Gets a flow log resource by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String flowLogName); + + /** + * Deletes the specified flow log resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param flowLogName The name of the flow log resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String flowLogName, Context context); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all flow log resources for the specified Network Watcher. + * + * @param resourceGroupName The name of the resource group containing Network Watcher. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); + + /** + * Gets a flow log resource by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flow log resource by name 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/GatewayLoadBalancerTunnelInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java new file mode 100644 index 0000000000000..cfa30e7d20512 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway load balancer tunnel interface of a load balancer backend address pool. */ +@Fluent +public final class GatewayLoadBalancerTunnelInterface { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayLoadBalancerTunnelInterface.class); + + /* + * Port of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Identifier of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "identifier") + private Integer identifier; + + /* + * Protocol of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "protocol") + private GatewayLoadBalancerTunnelProtocol protocol; + + /* + * Traffic type of gateway load balancer tunnel interface. + */ + @JsonProperty(value = "type") + private GatewayLoadBalancerTunnelInterfaceType type; + + /** + * Get the port property: Port of gateway load balancer tunnel interface. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port of gateway load balancer tunnel interface. + * + * @param port the port value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the identifier property: Identifier of gateway load balancer tunnel interface. + * + * @return the identifier value. + */ + public Integer identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Identifier of gateway load balancer tunnel interface. + * + * @param identifier the identifier value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withIdentifier(Integer identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the protocol property: Protocol of gateway load balancer tunnel interface. + * + * @return the protocol value. + */ + public GatewayLoadBalancerTunnelProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol of gateway load balancer tunnel interface. + * + * @param protocol the protocol value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withProtocol(GatewayLoadBalancerTunnelProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the type property: Traffic type of gateway load balancer tunnel interface. + * + * @return the type value. + */ + public GatewayLoadBalancerTunnelInterfaceType type() { + return this.type; + } + + /** + * Set the type property: Traffic type of gateway load balancer tunnel interface. + * + * @param type the type value to set. + * @return the GatewayLoadBalancerTunnelInterface object itself. + */ + public GatewayLoadBalancerTunnelInterface withType(GatewayLoadBalancerTunnelInterfaceType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java new file mode 100644 index 0000000000000..6f6ad0d682d51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GatewayLoadBalancerTunnelInterfaceType. */ +public final class GatewayLoadBalancerTunnelInterfaceType + extends ExpandableStringEnum { + /** Static value None for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType NONE = fromString("None"); + + /** Static value Internal for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType INTERNAL = fromString("Internal"); + + /** Static value External for GatewayLoadBalancerTunnelInterfaceType. */ + public static final GatewayLoadBalancerTunnelInterfaceType EXTERNAL = fromString("External"); + + /** + * Creates or finds a GatewayLoadBalancerTunnelInterfaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelInterfaceType. + */ + @JsonCreator + public static GatewayLoadBalancerTunnelInterfaceType fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelInterfaceType.class); + } + + /** @return known GatewayLoadBalancerTunnelInterfaceType values. */ + public static Collection values() { + return values(GatewayLoadBalancerTunnelInterfaceType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java new file mode 100644 index 0000000000000..1b549952429a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GatewayLoadBalancerTunnelProtocol. */ +public final class GatewayLoadBalancerTunnelProtocol extends ExpandableStringEnum { + /** Static value None for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol NONE = fromString("None"); + + /** Static value Native for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol NATIVE = fromString("Native"); + + /** Static value VXLAN for GatewayLoadBalancerTunnelProtocol. */ + public static final GatewayLoadBalancerTunnelProtocol VXLAN = fromString("VXLAN"); + + /** + * Creates or finds a GatewayLoadBalancerTunnelProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelProtocol. + */ + @JsonCreator + public static GatewayLoadBalancerTunnelProtocol fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelProtocol.class); + } + + /** @return known GatewayLoadBalancerTunnelProtocol values. */ + public static Collection values() { + return values(GatewayLoadBalancerTunnelProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java new file mode 100644 index 0000000000000..eadfff33ae5ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway routing details. */ +@Immutable +public final class GatewayRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRoute.class); + + /* + * The gateway's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the localAddress property: The gateway's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the network property: The route's network prefix. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Get the nextHop property: The route's next hop. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the sourcePeer property: The peer this route was learned from. + * + * @return the sourcePeer value. + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the origin property: The source this route was learned from. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the asPath property: The route's AS path sequence. + * + * @return the asPath value. + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the weight property: The route's weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java new file mode 100644 index 0000000000000..d18816f72f7ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner; +import java.util.List; + +/** An immutable client-side representation of GatewayRouteListResult. */ +public interface GatewayRouteListResult { + /** + * Gets the value property: List of gateway routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GatewayRouteListResultInner object. + * + * @return the inner object. + */ + GatewayRouteListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java new file mode 100644 index 0000000000000..1126adf19b822 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The customer name to be printed on a letter of authorization. */ +@Fluent +public final class GenerateExpressRoutePortsLoaRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateExpressRoutePortsLoaRequest.class); + + /* + * The customer name. + */ + @JsonProperty(value = "customerName", required = true) + private String customerName; + + /** + * Get the customerName property: The customer name. + * + * @return the customerName value. + */ + public String customerName() { + return this.customerName; + } + + /** + * Set the customerName property: The customer name. + * + * @param customerName the customerName value to set. + * @return the GenerateExpressRoutePortsLoaRequest object itself. + */ + public GenerateExpressRoutePortsLoaRequest withCustomerName(String customerName) { + this.customerName = customerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property customerName in model GenerateExpressRoutePortsLoaRequest")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java new file mode 100644 index 0000000000000..c18a19619aa59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner; + +/** An immutable client-side representation of GenerateExpressRoutePortsLoaResult. */ +public interface GenerateExpressRoutePortsLoaResult { + /** + * Gets the encodedContent property: The content as a base64 encoded string. + * + * @return the encodedContent value. + */ + String encodedContent(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.GenerateExpressRoutePortsLoaResultInner + * object. + * + * @return the inner object. + */ + GenerateExpressRoutePortsLoaResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java new file mode 100644 index 0000000000000..64ada3b7428f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Vpn-Sites. */ +@Fluent +public final class GetVpnSitesConfigurationRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetVpnSitesConfigurationRequest.class); + + /* + * List of resource-ids of the vpn-sites for which config is to be + * downloaded. + */ + @JsonProperty(value = "vpnSites") + private List vpnSites; + + /* + * The sas-url to download the configurations for vpn-sites. + */ + @JsonProperty(value = "outputBlobSasUrl", required = true) + private String outputBlobSasUrl; + + /** + * Get the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @return the vpnSites value. + */ + public List vpnSites() { + return this.vpnSites; + } + + /** + * Set the vpnSites property: List of resource-ids of the vpn-sites for which config is to be downloaded. + * + * @param vpnSites the vpnSites value to set. + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withVpnSites(List vpnSites) { + this.vpnSites = vpnSites; + return this; + } + + /** + * Get the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. + * + * @return the outputBlobSasUrl value. + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the outputBlobSasUrl property: The sas-url to download the configurations for vpn-sites. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set. + * @return the GetVpnSitesConfigurationRequest object itself. + */ + public GetVpnSitesConfigurationRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outputBlobSasUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property outputBlobSasUrl in model GetVpnSitesConfigurationRequest")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java new file mode 100644 index 0000000000000..5afd8c2c6504b --- /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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HopLinkProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Hop link. */ +@Fluent +public final class HopLink { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HopLink.class); + + /* + * The ID of the next hop. + */ + @JsonProperty(value = "nextHopId", access = JsonProperty.Access.WRITE_ONLY) + private String nextHopId; + + /* + * Link type. + */ + @JsonProperty(value = "linkType", access = JsonProperty.Access.WRITE_ONLY) + private String linkType; + + /* + * 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; + + /** + * 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..4712cc35ca41c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HTTP configuration of the connectivity check. */ +@Fluent +public final class HttpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpConfiguration.class); + + /* + * HTTP method. + */ + @JsonProperty(value = "method") + private HttpMethod method; + + /* + * List of HTTP headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * Valid status codes. + */ + @JsonProperty(value = "validStatusCodes") + private List validStatusCodes; + + /** + * Get the method property: HTTP method. + * + * @return the method value. + */ + public HttpMethod method() { + return this.method; + } + + /** + * Set the method property: HTTP method. + * + * @param method the method value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withMethod(HttpMethod method) { + this.method = method; + return this; + } + + /** + * Get the headers property: List of HTTP headers. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: List of HTTP headers. + * + * @param headers the headers value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the validStatusCodes property: Valid status codes. + * + * @return the validStatusCodes value. + */ + public List validStatusCodes() { + return this.validStatusCodes; + } + + /** + * Set the validStatusCodes property: Valid status codes. + * + * @param validStatusCodes the validStatusCodes value to set. + * @return the HttpConfiguration object itself. + */ + public HttpConfiguration withValidStatusCodes(List validStatusCodes) { + this.validStatusCodes = validStatusCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java new file mode 100644 index 0000000000000..4bbd77f473792 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpConfigurationMethod. */ +public final class HttpConfigurationMethod extends ExpandableStringEnum { + /** Static value Get for HttpConfigurationMethod. */ + public static final HttpConfigurationMethod GET = fromString("Get"); + + /** Static value Post for HttpConfigurationMethod. */ + public static final HttpConfigurationMethod POST = fromString("Post"); + + /** + * Creates or finds a HttpConfigurationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpConfigurationMethod. + */ + @JsonCreator + public static HttpConfigurationMethod fromString(String name) { + return fromString(name, HttpConfigurationMethod.class); + } + + /** @return known HttpConfigurationMethod values. */ + public static Collection values() { + return values(HttpConfigurationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java new file mode 100644 index 0000000000000..bedc89ab15896 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The HTTP header. */ +@Fluent +public final class HttpHeader { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpHeader.class); + + /* + * The name in HTTP header. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The value in HTTP header. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The name in HTTP header. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name in HTTP header. + * + * @param name the name value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value in HTTP header. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value in HTTP header. + * + * @param value the value value to set. + * @return the HttpHeader object itself. + */ + public HttpHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java new file mode 100644 index 0000000000000..bdd6c27483913 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpMethod. */ +public final class HttpMethod extends ExpandableStringEnum { + /** Static value Get for HttpMethod. */ + public static final HttpMethod GET = fromString("Get"); + + /** + * Creates or finds a HttpMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpMethod. + */ + @JsonCreator + public static HttpMethod fromString(String name) { + return fromString(name, HttpMethod.class); + } + + /** @return known HttpMethod values. */ + public static Collection values() { + return values(HttpMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java new file mode 100644 index 0000000000000..ec6c4cdaa593d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HubBgpConnectionStatus. */ +public final class HubBgpConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for HubBgpConnectionStatus. */ + public static final HubBgpConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a HubBgpConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HubBgpConnectionStatus. + */ + @JsonCreator + public static HubBgpConnectionStatus fromString(String name) { + return fromString(name, HubBgpConnectionStatus.class); + } + + /** @return known HubBgpConnectionStatus values. */ + public static Collection values() { + return values(HubBgpConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java new file mode 100644 index 0000000000000..7285c85dce0df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP addresses associated with azure firewall. */ +@Fluent +public final class HubIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubIpAddresses.class); + + /* + * Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "publicIPs") + private HubPublicIpAddresses publicIPs; + + /* + * Private IP Address associated with azure firewall. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /** + * Get the publicIPs property: Public IP addresses associated with azure firewall. + * + * @return the publicIPs value. + */ + public HubPublicIpAddresses publicIPs() { + return this.publicIPs; + } + + /** + * Set the publicIPs property: Public IP addresses associated with azure firewall. + * + * @param publicIPs the publicIPs value to set. + * @return the HubIpAddresses object itself. + */ + public HubIpAddresses withPublicIPs(HubPublicIpAddresses publicIPs) { + this.publicIPs = publicIPs; + return this; + } + + /** + * Get the privateIpAddress property: Private IP Address associated with azure firewall. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP Address associated with azure firewall. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the HubIpAddresses object itself. + */ + public HubIpAddresses withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIPs() != null) { + publicIPs().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java new file mode 100644 index 0000000000000..16aa3620fabfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; + +/** An immutable client-side representation of HubIpConfiguration. */ +public interface HubIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the Ip Configuration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Ipconfiguration type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner object. + * + * @return the inner object. + */ + HubIpConfigurationInner innerModel(); + + /** The entirety of the HubIpConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The HubIpConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the HubIpConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the HubIpConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + /** + * The stage of the HubIpConfiguration definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithPrivateIpAddress, + DefinitionStages.WithPrivateIpAllocationMethod, + DefinitionStages.WithSubnet, + DefinitionStages.WithPublicIpAddress { + /** + * Executes the create request. + * + * @return the created resource. + */ + HubIpConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HubIpConfiguration create(Context context); + } + /** The stage of the HubIpConfiguration definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the Ip Configuration.. + * + * @param name Name of the Ip Configuration. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the HubIpConfiguration definition allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address of the IP configuration.. + * + * @param privateIpAddress The private IP address of the IP configuration. + * @return the next definition stage. + */ + WithCreate withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the HubIpConfiguration definition allowing to specify privateIpAllocationMethod. */ + interface WithPrivateIpAllocationMethod { + /** + * Specifies the privateIpAllocationMethod property: The private IP address allocation method.. + * + * @param privateIpAllocationMethod The private IP address allocation method. + * @return the next definition stage. + */ + WithCreate withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod); + } + /** The stage of the HubIpConfiguration definition allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The reference to the subnet resource.. + * + * @param subnet The reference to the subnet resource. + * @return the next definition stage. + */ + WithCreate withSubnet(SubnetInner subnet); + } + /** The stage of the HubIpConfiguration definition allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The reference to the public IP resource.. + * + * @param publicIpAddress The reference to the public IP resource. + * @return the next definition stage. + */ + WithCreate withPublicIpAddress(PublicIpAddressInner publicIpAddress); + } + } + /** + * Begins update for the HubIpConfiguration resource. + * + * @return the stage of resource update. + */ + HubIpConfiguration.Update update(); + + /** The template for HubIpConfiguration update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithPrivateIpAddress, + UpdateStages.WithPrivateIpAllocationMethod, + UpdateStages.WithSubnet, + UpdateStages.WithPublicIpAddress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HubIpConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HubIpConfiguration apply(Context context); + } + /** The HubIpConfiguration update stages. */ + interface UpdateStages { + /** The stage of the HubIpConfiguration update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the Ip Configuration.. + * + * @param name Name of the Ip Configuration. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the HubIpConfiguration update allowing to specify privateIpAddress. */ + interface WithPrivateIpAddress { + /** + * Specifies the privateIpAddress property: The private IP address of the IP configuration.. + * + * @param privateIpAddress The private IP address of the IP configuration. + * @return the next definition stage. + */ + Update withPrivateIpAddress(String privateIpAddress); + } + /** The stage of the HubIpConfiguration update allowing to specify privateIpAllocationMethod. */ + interface WithPrivateIpAllocationMethod { + /** + * Specifies the privateIpAllocationMethod property: The private IP address allocation method.. + * + * @param privateIpAllocationMethod The private IP address allocation method. + * @return the next definition stage. + */ + Update withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod); + } + /** The stage of the HubIpConfiguration update allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: The reference to the subnet resource.. + * + * @param subnet The reference to the subnet resource. + * @return the next definition stage. + */ + Update withSubnet(SubnetInner subnet); + } + /** The stage of the HubIpConfiguration update allowing to specify publicIpAddress. */ + interface WithPublicIpAddress { + /** + * Specifies the publicIpAddress property: The reference to the public IP resource.. + * + * @param publicIpAddress The reference to the public IP resource. + * @return the next definition stage. + */ + Update withPublicIpAddress(PublicIpAddressInner publicIpAddress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HubIpConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HubIpConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..43509a5d047a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Public IP addresses associated with azure firewall. */ +@Fluent +public final class HubPublicIpAddresses { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubPublicIpAddresses.class); + + /* + * The list of Public IP addresses associated with azure firewall or IP + * addresses to be retained. + */ + @JsonProperty(value = "addresses") + private List addresses; + + /* + * The number of Public IP addresses associated with azure firewall. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the addresses property: The list of Public IP addresses associated with azure firewall or IP addresses to be + * retained. + * + * @return the addresses value. + */ + public List addresses() { + return this.addresses; + } + + /** + * Set the addresses property: The list of Public IP addresses associated with azure firewall or IP addresses to be + * retained. + * + * @param addresses the addresses value to set. + * @return the HubPublicIpAddresses object itself. + */ + public HubPublicIpAddresses withAddresses(List addresses) { + this.addresses = addresses; + return this; + } + + /** + * Get the count property: The number of Public IP addresses associated with azure firewall. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The number of Public IP addresses associated with azure firewall. + * + * @param count the count value to set. + * @return the HubPublicIpAddresses object itself. + */ + public HubPublicIpAddresses withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (addresses() != null) { + addresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java new file mode 100644 index 0000000000000..3ef41ee4f9692 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RouteTable route. */ +@Fluent +public final class HubRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HubRoute.class); + + /* + * The name of the Route that is unique within a RouteTable. This name can + * be used to access this route. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of destinations (eg: CIDR, ResourceId, Service). + */ + @JsonProperty(value = "destinationType", required = true) + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations", required = true) + private List destinations; + + /* + * The type of next hop (eg: ResourceId). + */ + @JsonProperty(value = "nextHopType", required = true) + private String nextHopType; + + /* + * NextHop resource ID. + */ + @JsonProperty(value = "nextHop", required = true) + private String nextHop; + + /** + * Get the name property: The name of the Route that is unique within a RouteTable. This name can be used to access + * this route. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the Route that is unique within a RouteTable. This name can be used to access + * this route. + * + * @param name the name value to set. + * @return the HubRoute object itself. + */ + public HubRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the destinationType property: The type of destinations (eg: CIDR, ResourceId, Service). + * + * @return the destinationType value. + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Set the destinationType property: The type of destinations (eg: CIDR, ResourceId, Service). + * + * @param destinationType the destinationType value to set. + * @return the HubRoute object itself. + */ + public HubRoute withDestinationType(String destinationType) { + this.destinationType = destinationType; + return this; + } + + /** + * Get the destinations property: List of all destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of all destinations. + * + * @param destinations the destinations value to set. + * @return the HubRoute object itself. + */ + public HubRoute withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the nextHopType property: The type of next hop (eg: ResourceId). + * + * @return the nextHopType value. + */ + public String nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of next hop (eg: ResourceId). + * + * @param nextHopType the nextHopType value to set. + * @return the HubRoute object itself. + */ + public HubRoute withNextHopType(String nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHop property: NextHop resource ID. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: NextHop resource ID. + * + * @param nextHop the nextHop value to set. + * @return the HubRoute object itself. + */ + public HubRoute withNextHop(String nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model HubRoute")); + } + if (destinationType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinationType in model HubRoute")); + } + if (destinations() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property destinations in model HubRoute")); + } + if (nextHopType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHopType in model HubRoute")); + } + if (nextHop() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nextHop in model HubRoute")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java new file mode 100644 index 0000000000000..2a1367d7e2ffc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import java.util.List; + +/** An immutable client-side representation of HubRouteTable. */ +public interface HubRouteTable { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the routes property: List of all routes. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the labels property: List of labels associated with this route table. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the associatedConnections property: List of all connections associated with this route table. + * + * @return the associatedConnections value. + */ + List associatedConnections(); + + /** + * Gets the propagatingConnections property: List of all connections that advertise to this route table. + * + * @return the propagatingConnections value. + */ + List propagatingConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the RouteTable resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner object. + * + * @return the inner object. + */ + HubRouteTableInner innerModel(); + + /** The entirety of the HubRouteTable definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The HubRouteTable definition stages. */ + interface DefinitionStages { + /** The first stage of the HubRouteTable definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the HubRouteTable definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + /** + * The stage of the HubRouteTable definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, DefinitionStages.WithRoutes, DefinitionStages.WithLabels { + /** + * Executes the create request. + * + * @return the created resource. + */ + HubRouteTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HubRouteTable create(Context context); + } + /** The stage of the HubRouteTable definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the HubRouteTable definition allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: List of all routes.. + * + * @param routes List of all routes. + * @return the next definition stage. + */ + WithCreate withRoutes(List routes); + } + /** The stage of the HubRouteTable definition allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels associated with this route table.. + * + * @param labels List of labels associated with this route table. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + } + /** + * Begins update for the HubRouteTable resource. + * + * @return the stage of resource update. + */ + HubRouteTable.Update update(); + + /** The template for HubRouteTable update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRoutes, UpdateStages.WithLabels { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HubRouteTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HubRouteTable apply(Context context); + } + /** The HubRouteTable update stages. */ + interface UpdateStages { + /** The stage of the HubRouteTable update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the HubRouteTable update allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: List of all routes.. + * + * @param routes List of all routes. + * @return the next definition stage. + */ + Update withRoutes(List routes); + } + /** The stage of the HubRouteTable update allowing to specify labels. */ + interface WithLabels { + /** + * Specifies the labels property: List of labels associated with this route table.. + * + * @param labels List of labels associated with this route table. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HubRouteTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HubRouteTable refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java new file mode 100644 index 0000000000000..4e36de90948ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of HubRouteTables. */ +public interface HubRouteTables { + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub. + */ + HubRouteTable get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a RouteTable. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Deletes a RouteTable. + * + * @param resourceGroupName The resource group name of the RouteTable. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteTables. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a RouteTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routeTable resource in a virtual hub 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/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..d5f2050ac0bc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; + +/** Resource collection API of HubVirtualNetworkConnections. */ +public interface HubVirtualNetworkConnections { + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters); + + /** + * Creates a hub virtual network connection if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the HubVirtualNetworkConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param hubVirtualNetworkConnectionParameters Parameters supplied to create or update a hub virtual network + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection createOrUpdate( + String resourceGroupName, + String virtualHubName, + String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, + Context context); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Deletes a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the HubVirtualNetworkConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource. + */ + HubVirtualNetworkConnection get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a HubVirtualNetworkConnection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hubVirtualNetworkConnection Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all HubVirtualNetworkConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..7e0efbde90bf4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdpsQueryObject.class); + + /* + * 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; + + /** + * 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..19fb20f30e789 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IkeEncryption. */ +public final class IkeEncryption extends ExpandableStringEnum { + /** Static value DES for IkeEncryption. */ + public static final IkeEncryption DES = fromString("DES"); + + /** Static value DES3 for IkeEncryption. */ + public static final IkeEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IkeEncryption. */ + public static final IkeEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IkeEncryption. */ + public static final IkeEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IkeEncryption. */ + public static final IkeEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES256 for IkeEncryption. */ + public static final IkeEncryption GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeEncryption. */ + public static final IkeEncryption GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeEncryption. + */ + @JsonCreator + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** @return known IkeEncryption values. */ + public static Collection values() { + return values(IkeEncryption.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java new file mode 100644 index 0000000000000..a39f6581bda74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IkeIntegrity. */ +public final class IkeIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IkeIntegrity. */ + public static final IkeIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IkeIntegrity. */ + public static final IkeIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IkeIntegrity. */ + public static final IkeIntegrity SHA256 = fromString("SHA256"); + + /** Static value SHA384 for IkeIntegrity. */ + public static final IkeIntegrity SHA384 = fromString("SHA384"); + + /** Static value GCMAES256 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES256 = fromString("GCMAES256"); + + /** Static value GCMAES128 for IkeIntegrity. */ + public static final IkeIntegrity GCMAES128 = fromString("GCMAES128"); + + /** + * Creates or finds a IkeIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeIntegrity. + */ + @JsonCreator + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** @return known IkeIntegrity values. */ + public static Collection values() { + return values(IkeIntegrity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java new file mode 100644 index 0000000000000..a55a66f1679ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatPoolPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Inbound NAT pool of the load balancer. */ +@Fluent +public final class InboundNatPool extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatPool.class); + + /* + * 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; + + /** + * 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..3d7b001e9c4dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.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.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 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..cc16811a008c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListInboundNatRule API service call. */ +@Fluent +public final class InboundNatRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRuleListResult.class); + + /* + * A list of inbound NAT rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of inbound NAT rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of inbound NAT rules in a load balancer. + * + * @param value the value value to set. + * @return the InboundNatRuleListResult object itself. + */ + public InboundNatRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..71c105b50cbff --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Individual port mappings for inbound NAT rule created for backend pool. */ +@Immutable +public final class InboundNatRulePortMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundNatRulePortMapping.class); + + /* + * 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; + + /** + * 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..be755b0a7bf19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of InboundNatRules. */ +public interface InboundNatRules { + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the inbound NAT rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the inbound NAT rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Deletes the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String loadBalancerName, String inboundNatRuleName, Context context); + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule. + */ + InboundNatRule get(String resourceGroupName, String loadBalancerName, String inboundNatRuleName); + + /** + * Gets the specified load balancer inbound NAT rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param inboundNatRuleName The name of the inbound NAT rule. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer inbound NAT rule 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 id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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..d5790205b2c50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of InboundSecurityRule. */ +public interface InboundSecurityRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of security rule collection. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: NVA inbound security rule type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the rules property: List of allowed rules. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner object. + * + * @return the inner object. + */ + InboundSecurityRuleInner innerModel(); + + /** The entirety of the InboundSecurityRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The InboundSecurityRule definition stages. */ + interface DefinitionStages { + /** The first stage of the InboundSecurityRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the InboundSecurityRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkVirtualApplianceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName); + } + /** + * The stage of the InboundSecurityRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithName, DefinitionStages.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + InboundSecurityRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + InboundSecurityRule create(Context context); + } + /** The stage of the InboundSecurityRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the InboundSecurityRule definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the InboundSecurityRule resource. + * + * @return the stage of resource update. + */ + InboundSecurityRule.Update update(); + + /** The template for InboundSecurityRule update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + InboundSecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + InboundSecurityRule apply(Context context); + } + /** The InboundSecurityRule update stages. */ + interface UpdateStages { + /** The stage of the InboundSecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of security rule collection.. + * + * @param name Name of security rule collection. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the InboundSecurityRule update allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: List of allowed rules.. + * + * @param rules List of allowed rules. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java new file mode 100644 index 0000000000000..e1477f1385f72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +/** Resource collection API of InboundSecurityRuleOperations. */ +public interface InboundSecurityRuleOperations { + /** + * Begins definition for a new InboundSecurityRule resource. + * + * @param name resource name. + * @return the first stage of the new InboundSecurityRule definition. + */ + InboundSecurityRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java new file mode 100644 index 0000000000000..bb1b4e44a6f32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Inbound Security Rules resource. */ +@Fluent +public final class InboundSecurityRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InboundSecurityRules.class); + + /* + * Protocol. This should be either TCP or UDP. + */ + @JsonProperty(value = "protocol") + private InboundSecurityRulesProtocol protocol; + + /* + * The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are + * allowed. + */ + @JsonProperty(value = "sourceAddressPrefix") + private String sourceAddressPrefix; + + /* + * NVA port ranges to be opened up. One needs to provide specific ports. + */ + @JsonProperty(value = "destinationPortRange") + private Integer destinationPortRange; + + /** + * Get the protocol property: Protocol. This should be either TCP or UDP. + * + * @return the protocol value. + */ + public InboundSecurityRulesProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol. This should be either TCP or UDP. + * + * @param protocol the protocol value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withProtocol(InboundSecurityRulesProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + + /** + * Get the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @return the destinationPortRange value. + */ + public Integer destinationPortRange() { + return this.destinationPortRange; + } + + /** + * Set the destinationPortRange property: NVA port ranges to be opened up. One needs to provide specific ports. + * + * @param destinationPortRange the destinationPortRange value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withDestinationPortRange(Integer destinationPortRange) { + this.destinationPortRange = destinationPortRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java new file mode 100644 index 0000000000000..456e6cba69325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InboundSecurityRulesProtocol. */ +public final class InboundSecurityRulesProtocol extends ExpandableStringEnum { + /** Static value TCP for InboundSecurityRulesProtocol. */ + public static final InboundSecurityRulesProtocol TCP = fromString("TCP"); + + /** Static value UDP for InboundSecurityRulesProtocol. */ + public static final InboundSecurityRulesProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a InboundSecurityRulesProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding InboundSecurityRulesProtocol. + */ + @JsonCreator + public static InboundSecurityRulesProtocol fromString(String name) { + return fromString(name, InboundSecurityRulesProtocol.class); + } + + /** @return known InboundSecurityRulesProtocol values. */ + public static Collection values() { + return values(InboundSecurityRulesProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java new file mode 100644 index 0000000000000..606a45cde6697 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner; +import java.util.List; + +/** An immutable client-side representation of IpAddressAvailabilityResult. */ +public interface IpAddressAvailabilityResult { + /** + * Gets the available property: Private IP address availability. + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the availableIpAddresses property: Contains other available private IP addresses if the asked for address is + * taken. + * + * @return the availableIpAddresses value. + */ + List availableIpAddresses(); + + /** + * Gets the isPlatformReserved property: Private IP address platform reserved. + * + * @return the isPlatformReserved value. + */ + Boolean isPlatformReserved(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpAddressAvailabilityResultInner object. + * + * @return the inner object. + */ + IpAddressAvailabilityResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java new file mode 100644 index 0000000000000..976ea9efa59d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import java.util.Map; + +/** An immutable client-side representation of IpAllocation. */ +public interface IpAllocation { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner object. + * + * @return the inner object. + */ + IpAllocationInner innerModel(); + + /** The entirety of the IpAllocation definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpAllocation definition stages. */ + interface DefinitionStages { + /** The first stage of the IpAllocation definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpAllocation definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the IpAllocation definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the IpAllocation definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithPrefix, + DefinitionStages.WithPrefixLength, + DefinitionStages.WithPrefixType, + DefinitionStages.WithIpamAllocationId, + DefinitionStages.WithAllocationTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpAllocation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpAllocation create(Context context); + } + /** The stage of the IpAllocation definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the IpAllocation definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type for the IpAllocation.. + * + * @param typePropertiesType The type for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(IpAllocationType typePropertiesType); + } + /** The stage of the IpAllocation definition allowing to specify prefix. */ + interface WithPrefix { + /** + * Specifies the prefix property: The address prefix for the IpAllocation.. + * + * @param prefix The address prefix for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefix(String prefix); + } + /** The stage of the IpAllocation definition allowing to specify prefixLength. */ + interface WithPrefixLength { + /** + * Specifies the prefixLength property: The address prefix length for the IpAllocation.. + * + * @param prefixLength The address prefix length for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefixLength(Integer prefixLength); + } + /** The stage of the IpAllocation definition allowing to specify prefixType. */ + interface WithPrefixType { + /** + * Specifies the prefixType property: The address prefix Type for the IpAllocation.. + * + * @param prefixType The address prefix Type for the IpAllocation. + * @return the next definition stage. + */ + WithCreate withPrefixType(IpVersion prefixType); + } + /** The stage of the IpAllocation definition allowing to specify ipamAllocationId. */ + interface WithIpamAllocationId { + /** + * Specifies the ipamAllocationId property: The IPAM allocation ID.. + * + * @param ipamAllocationId The IPAM allocation ID. + * @return the next definition stage. + */ + WithCreate withIpamAllocationId(String ipamAllocationId); + } + /** The stage of the IpAllocation definition allowing to specify allocationTags. */ + interface WithAllocationTags { + /** + * Specifies the allocationTags property: IpAllocation tags.. + * + * @param allocationTags IpAllocation tags. + * @return the next definition stage. + */ + WithCreate withAllocationTags(Map allocationTags); + } + } + /** + * Begins update for the IpAllocation resource. + * + * @return the stage of resource update. + */ + IpAllocation.Update update(); + + /** The template for IpAllocation update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpAllocation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpAllocation apply(Context context); + } + /** The IpAllocation update stages. */ + interface UpdateStages { + /** The stage of the IpAllocation update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpAllocation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpAllocation refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java new file mode 100644 index 0000000000000..fd03b446b85c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpAllocations API service call. */ +@Fluent +public final class IpAllocationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAllocationListResult.class); + + /* + * A list of IpAllocation resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of IpAllocation resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of IpAllocation resources. + * + * @param value the value value to set. + * @return the IpAllocationListResult object itself. + */ + public IpAllocationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the IpAllocationListResult object itself. + */ + public IpAllocationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java new file mode 100644 index 0000000000000..9ec4de11fa1aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAllocationMethod. */ +public final class IpAllocationMethod extends ExpandableStringEnum { + /** Static value Static for IpAllocationMethod. */ + public static final IpAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for IpAllocationMethod. */ + public static final IpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a IpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationMethod. + */ + @JsonCreator + public static IpAllocationMethod fromString(String name) { + return fromString(name, IpAllocationMethod.class); + } + + /** @return known IpAllocationMethod values. */ + public static Collection values() { + return values(IpAllocationMethod.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java new file mode 100644 index 0000000000000..5832c5c537b99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpAllocationType. */ +public final class IpAllocationType extends ExpandableStringEnum { + /** Static value Undefined for IpAllocationType. */ + public static final IpAllocationType UNDEFINED = fromString("Undefined"); + + /** Static value Hypernet for IpAllocationType. */ + public static final IpAllocationType HYPERNET = fromString("Hypernet"); + + /** + * Creates or finds a IpAllocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationType. + */ + @JsonCreator + public static IpAllocationType fromString(String name) { + return fromString(name, IpAllocationType.class); + } + + /** @return known IpAllocationType values. */ + public static Collection values() { + return values(IpAllocationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java new file mode 100644 index 0000000000000..d9930216a4bfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpAllocations. */ +public interface IpAllocations { + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Deletes the specified IpAllocation. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ipAllocationName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group. + */ + IpAllocation getByResourceGroup(String resourceGroupName, String ipAllocationName); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param ipAllocationName The name of the IpAllocation. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipAllocationName, String expand, Context context); + + /** + * Gets all IpAllocations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + PagedIterable list(); + + /** + * Gets all IpAllocations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpAllocations in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpAllocations in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified IpAllocation by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified IpAllocation by resource group 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..6a5b16b39b8d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of IPConfigurationBgpPeeringAddress. */ +@Fluent +public final class IpConfigurationBgpPeeringAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpConfigurationBgpPeeringAddress.class); + + /* + * The ID of IP configuration which belongs to gateway. + */ + @JsonProperty(value = "ipconfigurationId") + private String ipconfigurationId; + + /* + * The list of default BGP peering addresses which belong to IP + * configuration. + */ + @JsonProperty(value = "defaultBgpIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List defaultBgpIpAddresses; + + /* + * The list of custom BGP peering addresses which belong to IP + * configuration. + */ + @JsonProperty(value = "customBgpIpAddresses") + private List customBgpIpAddresses; + + /* + * The list of tunnel public IP addresses which belong to IP configuration. + */ + @JsonProperty(value = "tunnelIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List tunnelIpAddresses; + + /** + * Get the ipconfigurationId property: The ID of IP configuration which belongs to gateway. + * + * @return the ipconfigurationId value. + */ + public String ipconfigurationId() { + return this.ipconfigurationId; + } + + /** + * Set the ipconfigurationId property: The ID of IP configuration which belongs to gateway. + * + * @param ipconfigurationId the ipconfigurationId value to set. + * @return the IpConfigurationBgpPeeringAddress object itself. + */ + public IpConfigurationBgpPeeringAddress withIpconfigurationId(String ipconfigurationId) { + this.ipconfigurationId = ipconfigurationId; + return this; + } + + /** + * Get the defaultBgpIpAddresses property: The list of default BGP peering addresses which belong to IP + * configuration. + * + * @return the defaultBgpIpAddresses value. + */ + public List defaultBgpIpAddresses() { + return this.defaultBgpIpAddresses; + } + + /** + * Get the customBgpIpAddresses property: The list of custom BGP peering addresses which belong to IP configuration. + * + * @return the customBgpIpAddresses value. + */ + public List customBgpIpAddresses() { + return this.customBgpIpAddresses; + } + + /** + * Set the customBgpIpAddresses property: The list of custom BGP peering addresses which belong to IP configuration. + * + * @param customBgpIpAddresses the customBgpIpAddresses value to set. + * @return the IpConfigurationBgpPeeringAddress object itself. + */ + public IpConfigurationBgpPeeringAddress withCustomBgpIpAddresses(List customBgpIpAddresses) { + this.customBgpIpAddresses = customBgpIpAddresses; + return this; + } + + /** + * Get the tunnelIpAddresses property: The list of tunnel public IP addresses which belong to IP configuration. + * + * @return the tunnelIpAddresses value. + */ + public List tunnelIpAddresses() { + return this.tunnelIpAddresses; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java new file mode 100644 index 0000000000000..89b3bf2909057 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; + +/** An immutable client-side representation of IpConfigurationProfile. */ +public interface IpConfigurationProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Sub Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the subnet property: The reference to the subnet resource to create a container network interface ip + * configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the provisioningState property: The provisioning state of the IP configuration profile resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner object. + * + * @return the inner object. + */ + IpConfigurationProfileInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..67a3adb9f225d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpFlowProtocol. */ +public final class IpFlowProtocol extends ExpandableStringEnum { + /** Static value TCP for IpFlowProtocol. */ + public static final IpFlowProtocol TCP = fromString("TCP"); + + /** Static value UDP for IpFlowProtocol. */ + public static final IpFlowProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpFlowProtocol. + */ + @JsonCreator + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** @return known IpFlowProtocol values. */ + public static Collection values() { + return values(IpFlowProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java new file mode 100644 index 0000000000000..7f171aaa38c4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of IpGroup. */ +public interface IpGroup { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner object. + * + * @return the inner object. + */ + IpGroupInner innerModel(); + + /** The entirety of the IpGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The IpGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the IpGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the IpGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the IpGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the IpGroup definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIpAddresses { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpGroup create(Context context); + } + /** The stage of the IpGroup definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the IpGroup definition allowing to specify ipAddresses. */ + interface WithIpAddresses { + /** + * Specifies the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource.. + * + * @param ipAddresses IpAddresses/IpAddressPrefixes in the IpGroups resource. + * @return the next definition stage. + */ + WithCreate withIpAddresses(List ipAddresses); + } + } + /** + * Begins update for the IpGroup resource. + * + * @return the stage of resource update. + */ + IpGroup.Update update(); + + /** The template for IpGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpGroup apply(Context context); + } + /** The IpGroup update stages. */ + interface UpdateStages { + /** The stage of the IpGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java new file mode 100644 index 0000000000000..4203e04701192 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListIpGroups API service call. */ +@Fluent +public final class IpGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpGroupListResult.class); + + /* + * The list of IpGroups information resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of IpGroups information resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of IpGroups information resources. + * + * @param value the value value to set. + * @return the IpGroupListResult object itself. + */ + public IpGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the IpGroupListResult object itself. + */ + public IpGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java new file mode 100644 index 0000000000000..57860e07e5cf0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpGroups. */ +public interface IpGroups { + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups. + */ + IpGroup getByResourceGroup(String resourceGroupName, String ipGroupsName); + + /** + * Gets the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param expand Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String ipGroupsName, String expand, Context context); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String ipGroupsName); + + /** + * Deletes the specified ipGroups. + * + * @param resourceGroupName The name of the resource group. + * @param ipGroupsName The name of the ipGroups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String ipGroupsName, Context context); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all IpGroups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all IpGroups in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all IpGroups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all IpGroups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified ipGroups. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified ipGroups 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/IpTag.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java new file mode 100644 index 0000000000000..9f5e10dd0c283 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the IpTag associated with the object. */ +@Fluent +public final class IpTag { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpTag.class); + + /* + * The IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * The value of the IP tag associated with the public IP. Example: SQL. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the ipTagType property: The IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: The IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the IpTag object itself. + */ + public IpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: The value of the IP tag associated with the public IP. Example: SQL. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The value of the IP tag associated with the public IP. Example: SQL. + * + * @param tag the tag value to set. + * @return the IpTag object itself. + */ + public IpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java new file mode 100644 index 0000000000000..ca34aa351a4f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpVersion. */ +public final class IpVersion extends ExpandableStringEnum { + /** Static value IPv4 for IpVersion. */ + public static final IpVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpVersion. */ + public static final IpVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** @return known IpVersion values. */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java new file mode 100644 index 0000000000000..b31aef1ee7add --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpsecEncryption. */ +public final class IpsecEncryption extends ExpandableStringEnum { + /** Static value None for IpsecEncryption. */ + public static final IpsecEncryption NONE = fromString("None"); + + /** Static value DES for IpsecEncryption. */ + public static final IpsecEncryption DES = fromString("DES"); + + /** Static value DES3 for IpsecEncryption. */ + public static final IpsecEncryption DES3 = fromString("DES3"); + + /** Static value AES128 for IpsecEncryption. */ + public static final IpsecEncryption AES128 = fromString("AES128"); + + /** Static value AES192 for IpsecEncryption. */ + public static final IpsecEncryption AES192 = fromString("AES192"); + + /** Static value AES256 for IpsecEncryption. */ + public static final IpsecEncryption AES256 = fromString("AES256"); + + /** Static value GCMAES128 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecEncryption. */ + public static final IpsecEncryption GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecEncryption. + */ + @JsonCreator + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** @return known IpsecEncryption values. */ + public static Collection values() { + return values(IpsecEncryption.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java new file mode 100644 index 0000000000000..e75ff9eeb82f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IpsecIntegrity. */ +public final class IpsecIntegrity extends ExpandableStringEnum { + /** Static value MD5 for IpsecIntegrity. */ + public static final IpsecIntegrity MD5 = fromString("MD5"); + + /** Static value SHA1 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA1 = fromString("SHA1"); + + /** Static value SHA256 for IpsecIntegrity. */ + public static final IpsecIntegrity SHA256 = fromString("SHA256"); + + /** Static value GCMAES128 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES128 = fromString("GCMAES128"); + + /** Static value GCMAES192 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES192 = fromString("GCMAES192"); + + /** Static value GCMAES256 for IpsecIntegrity. */ + public static final IpsecIntegrity GCMAES256 = fromString("GCMAES256"); + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecIntegrity. + */ + @JsonCreator + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** @return known IpsecIntegrity values. */ + public static Collection values() { + return values(IpsecIntegrity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java new file mode 100644 index 0000000000000..02dcd65061698 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IPSec Policy configuration for a virtual network gateway connection. */ +@Fluent +public final class IpsecPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpsecPolicy.class); + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + */ + @JsonProperty(value = "saLifeTimeSeconds", required = true) + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + */ + @JsonProperty(value = "saDataSizeKilobytes", required = true) + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecEncryption", required = true) + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + @JsonProperty(value = "ipsecIntegrity", required = true) + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeEncryption", required = true) + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + @JsonProperty(value = "ikeIntegrity", required = true) + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + @JsonProperty(value = "dhGroup", required = true) + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + @JsonProperty(value = "pfsGroup", required = true) + private PfsGroup pfsGroup; + + /** + * Get the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + * + * @return the saLifeTimeSeconds value. + */ + public int saLifeTimeSeconds() { + return this.saLifeTimeSeconds; + } + + /** + * Set the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for a site to site VPN tunnel. + * + * @param saLifeTimeSeconds the saLifeTimeSeconds value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaLifeTimeSeconds(int saLifeTimeSeconds) { + this.saLifeTimeSeconds = saLifeTimeSeconds; + return this; + } + + /** + * Get the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + * + * @return the saDataSizeKilobytes value. + */ + public int saDataSizeKilobytes() { + return this.saDataSizeKilobytes; + } + + /** + * Set the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for a site to site VPN tunnel. + * + * @param saDataSizeKilobytes the saDataSizeKilobytes value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withSaDataSizeKilobytes(int saDataSizeKilobytes) { + this.saDataSizeKilobytes = saDataSizeKilobytes; + return this; + } + + /** + * Get the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + public IpsecEncryption ipsecEncryption() { + return this.ipsecEncryption; + } + + /** + * Set the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @param ipsecEncryption the ipsecEncryption value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecEncryption(IpsecEncryption ipsecEncryption) { + this.ipsecEncryption = ipsecEncryption; + return this; + } + + /** + * Get the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + public IpsecIntegrity ipsecIntegrity() { + return this.ipsecIntegrity; + } + + /** + * Set the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @param ipsecIntegrity the ipsecIntegrity value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIpsecIntegrity(IpsecIntegrity ipsecIntegrity) { + this.ipsecIntegrity = ipsecIntegrity; + return this; + } + + /** + * Get the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + public IkeEncryption ikeEncryption() { + return this.ikeEncryption; + } + + /** + * Set the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @param ikeEncryption the ikeEncryption value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeEncryption(IkeEncryption ikeEncryption) { + this.ikeEncryption = ikeEncryption; + return this; + } + + /** + * Get the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + public IkeIntegrity ikeIntegrity() { + return this.ikeIntegrity; + } + + /** + * Set the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @param ikeIntegrity the ikeIntegrity value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withIkeIntegrity(IkeIntegrity ikeIntegrity) { + this.ikeIntegrity = ikeIntegrity; + return this; + } + + /** + * Get the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + public DhGroup dhGroup() { + return this.dhGroup; + } + + /** + * Set the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @param dhGroup the dhGroup value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withDhGroup(DhGroup dhGroup) { + this.dhGroup = dhGroup; + return this; + } + + /** + * Get the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + public PfsGroup pfsGroup() { + return this.pfsGroup; + } + + /** + * Set the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @param pfsGroup the pfsGroup value to set. + * @return the IpsecPolicy object itself. + */ + public IpsecPolicy withPfsGroup(PfsGroup pfsGroup) { + this.pfsGroup = pfsGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipsecEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecEncryption in model IpsecPolicy")); + } + if (ipsecIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipsecIntegrity in model IpsecPolicy")); + } + if (ikeEncryption() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeEncryption in model IpsecPolicy")); + } + if (ikeIntegrity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ikeIntegrity in model IpsecPolicy")); + } + if (dhGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dhGroup in model IpsecPolicy")); + } + if (pfsGroup() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property pfsGroup in model IpsecPolicy")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java new file mode 100644 index 0000000000000..fb38af6c7ac4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IPv6 Circuit Connection properties for global reach. */ +@Fluent +public final class Ipv6CircuitConnectionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6CircuitConnectionConfig.class); + + /* + * /125 IP address space to carve out customer addresses for global reach. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + @JsonProperty(value = "circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Get the addressPrefix property: /125 IP address space to carve out customer addresses for global reach. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: /125 IP address space to carve out customer addresses for global reach. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Ipv6CircuitConnectionConfig object itself. + */ + public Ipv6CircuitConnectionConfig withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java new file mode 100644 index 0000000000000..c22a21b578fb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains IPv6 peering config. */ +@Fluent +public final class Ipv6ExpressRouteCircuitPeeringConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6ExpressRouteCircuitPeeringConfig.class); + + /* + * The primary address prefix. + */ + @JsonProperty(value = "primaryPeerAddressPrefix") + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + @JsonProperty(value = "secondaryPeerAddressPrefix") + private String secondaryPeerAddressPrefix; + + /* + * The Microsoft peering configuration. + */ + @JsonProperty(value = "microsoftPeeringConfig") + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The reference to the RouteFilter resource. + */ + @JsonProperty(value = "routeFilter") + private SubResource routeFilter; + + /* + * The state of peering. + */ + @JsonProperty(value = "state") + private ExpressRouteCircuitPeeringState state; + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.primaryPeerAddressPrefix; + } + + /** + * Set the primaryPeerAddressPrefix property: The primary address prefix. + * + * @param primaryPeerAddressPrefix the primaryPeerAddressPrefix value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withPrimaryPeerAddressPrefix(String primaryPeerAddressPrefix) { + this.primaryPeerAddressPrefix = primaryPeerAddressPrefix; + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.secondaryPeerAddressPrefix; + } + + /** + * Set the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @param secondaryPeerAddressPrefix the secondaryPeerAddressPrefix value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withSecondaryPeerAddressPrefix(String secondaryPeerAddressPrefix) { + this.secondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.microsoftPeeringConfig; + } + + /** + * Set the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @param microsoftPeeringConfig the microsoftPeeringConfig value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withMicrosoftPeeringConfig( + ExpressRouteCircuitPeeringConfig microsoftPeeringConfig) { + this.microsoftPeeringConfig = microsoftPeeringConfig; + return this; + } + + /** + * Get the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + public SubResource routeFilter() { + return this.routeFilter; + } + + /** + * Set the routeFilter property: The reference to the RouteFilter resource. + * + * @param routeFilter the routeFilter value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withRouteFilter(SubResource routeFilter) { + this.routeFilter = routeFilter; + return this; + } + + /** + * Get the state property: The state of peering. + * + * @return the state value. + */ + public ExpressRouteCircuitPeeringState state() { + return this.state; + } + + /** + * Set the state property: The state of peering. + * + * @param state the state value to set. + * @return the Ipv6ExpressRouteCircuitPeeringConfig object itself. + */ + public Ipv6ExpressRouteCircuitPeeringConfig withState(ExpressRouteCircuitPeeringState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftPeeringConfig() != null) { + microsoftPeeringConfig().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java new file mode 100644 index 0000000000000..6a4c745c8ab06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IssueType. */ +public final class IssueType extends ExpandableStringEnum { + /** Static value Unknown for IssueType. */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** Static value AgentStopped for IssueType. */ + public static final IssueType AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value GuestFirewall for IssueType. */ + public static final IssueType GUEST_FIREWALL = fromString("GuestFirewall"); + + /** Static value DnsResolution for IssueType. */ + public static final IssueType DNS_RESOLUTION = fromString("DnsResolution"); + + /** Static value SocketBind for IssueType. */ + public static final IssueType SOCKET_BIND = fromString("SocketBind"); + + /** Static value NetworkSecurityRule for IssueType. */ + public static final IssueType NETWORK_SECURITY_RULE = fromString("NetworkSecurityRule"); + + /** Static value UserDefinedRoute for IssueType. */ + public static final IssueType USER_DEFINED_ROUTE = fromString("UserDefinedRoute"); + + /** Static value PortThrottled for IssueType. */ + public static final IssueType PORT_THROTTLED = fromString("PortThrottled"); + + /** Static value Platform for IssueType. */ + public static final IssueType PLATFORM = fromString("Platform"); + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + @JsonCreator + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** @return known IssueType values. */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java new file mode 100644 index 0000000000000..e5793aae016ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of RouteTables and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubRouteTablesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListHubRouteTablesResult.class); + + /* + * List of RouteTables. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of RouteTables. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RouteTables. + * + * @param value the value value to set. + * @return the ListHubRouteTablesResult object itself. + */ + public ListHubRouteTablesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListHubRouteTablesResult object itself. + */ + public ListHubRouteTablesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java new file mode 100644 index 0000000000000..5bc246e389b30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListHubVirtualNetworkConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListHubVirtualNetworkConnectionsResult.class); + + /* + * List of HubVirtualNetworkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of HubVirtualNetworkConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of HubVirtualNetworkConnections. + * + * @param value the value value to set. + * @return the ListHubVirtualNetworkConnectionsResult object itself. + */ + public ListHubVirtualNetworkConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListHubVirtualNetworkConnectionsResult object itself. + */ + public ListHubVirtualNetworkConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java new file mode 100644 index 0000000000000..f0c21000a9235 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways and a URL nextLink to get the next + * set of results. + */ +@Fluent +public final class ListP2SVpnGatewaysResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListP2SVpnGatewaysResult.class); + + /* + * List of P2SVpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of P2SVpnGateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of P2SVpnGateways. + * + * @param value the value value to set. + * @return the ListP2SVpnGatewaysResult object itself. + */ + public ListP2SVpnGatewaysResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListP2SVpnGatewaysResult object itself. + */ + public ListP2SVpnGatewaysResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..2b7a65471e918 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListRoutingIntentResult.class); + + /* + * 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; + + /** + * 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..73349b5f1e673 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubBgpConnections list. */ +@Fluent +public final class ListVirtualHubBgpConnectionResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubBgpConnectionResults.class); + + /* + * The list of VirtualHubBgpConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of VirtualHubBgpConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VirtualHubBgpConnections. + * + * @param value the value value to set. + * @return the ListVirtualHubBgpConnectionResults object itself. + */ + public ListVirtualHubBgpConnectionResults withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubBgpConnectionResults object itself. + */ + public ListVirtualHubBgpConnectionResults withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java new file mode 100644 index 0000000000000..970b045f2b351 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubIpConfigurations list. */ +@Fluent +public final class ListVirtualHubIpConfigurationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubIpConfigurationResults.class); + + /* + * The list of VirtualHubIpConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of VirtualHubIpConfigurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of VirtualHubIpConfigurations. + * + * @param value the value value to set. + * @return the ListVirtualHubIpConfigurationResults object itself. + */ + public ListVirtualHubIpConfigurationResults withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubIpConfigurationResults object itself. + */ + public ListVirtualHubIpConfigurationResults withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java new file mode 100644 index 0000000000000..1d8acd3e026eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. */ +@Fluent +public final class ListVirtualHubRouteTableV2SResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubRouteTableV2SResult.class); + + /* + * List of VirtualHubRouteTableV2s. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualHubRouteTableV2s. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualHubRouteTableV2s. + * + * @param value the value value to set. + * @return the ListVirtualHubRouteTableV2SResult object itself. + */ + public ListVirtualHubRouteTableV2SResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubRouteTableV2SResult object itself. + */ + public ListVirtualHubRouteTableV2SResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java new file mode 100644 index 0000000000000..95576986059e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualHubsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualHubsResult.class); + + /* + * List of VirtualHubs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualHubs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualHubs. + * + * @param value the value value to set. + * @return the ListVirtualHubsResult object itself. + */ + public ListVirtualHubsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualHubsResult object itself. + */ + public ListVirtualHubsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java new file mode 100644 index 0000000000000..ac3d8a934cf79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual network gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVirtualNetworkGatewayNatRulesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualNetworkGatewayNatRulesResult.class); + + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Nat Rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Nat Rules. + * + * @param value the value value to set. + * @return the ListVirtualNetworkGatewayNatRulesResult object itself. + */ + public ListVirtualNetworkGatewayNatRulesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualNetworkGatewayNatRulesResult object itself. + */ + public ListVirtualNetworkGatewayNatRulesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java new file mode 100644 index 0000000000000..d67d3b58da494 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVirtualWansResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVirtualWansResult.class); + + /* + * List of VirtualWANs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualWANs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualWANs. + * + * @param value the value value to set. + * @return the ListVirtualWansResult object itself. + */ + public ListVirtualWansResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVirtualWansResult object itself. + */ + public ListVirtualWansResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java new file mode 100644 index 0000000000000..519630e9ccd4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnConnectionsResult.class); + + /* + * List of Vpn Connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Vpn Connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Vpn Connections. + * + * @param value the value value to set. + * @return the ListVpnConnectionsResult object itself. + */ + public ListVpnConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnConnectionsResult object itself. + */ + public ListVpnConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java new file mode 100644 index 0000000000000..904c00ef8727d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all nat rules to a virtual wan vpn gateway. It contains a list of Nat rules and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnGatewayNatRulesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnGatewayNatRulesResult.class); + + /* + * List of Nat Rules. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Nat Rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Nat Rules. + * + * @param value the value value to set. + * @return the ListVpnGatewayNatRulesResult object itself. + */ + public ListVpnGatewayNatRulesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnGatewayNatRulesResult object itself. + */ + public ListVpnGatewayNatRulesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java new file mode 100644 index 0000000000000..0a1fa6fdef7b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnGateways. It contains a list of VpnGateways and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnGatewaysResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnGatewaysResult.class); + + /* + * List of VpnGateways. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnGateways. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnGateways. + * + * @param value the value value to set. + * @return the ListVpnGatewaysResult object itself. + */ + public ListVpnGatewaysResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnGatewaysResult object itself. + */ + public ListVpnGatewaysResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java new file mode 100644 index 0000000000000..5eec1674c28e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all VpnServerConfigurations. It contains a list of VpnServerConfigurations and a URL + * nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnServerConfigurationsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnServerConfigurationsResult.class); + + /* + * List of VpnServerConfigurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnServerConfigurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnServerConfigurations. + * + * @param value the value value to set. + * @return the ListVpnServerConfigurationsResult object itself. + */ + public ListVpnServerConfigurationsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnServerConfigurationsResult object itself. + */ + public ListVpnServerConfigurationsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java new file mode 100644 index 0000000000000..b7e0dd120ae05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections + * and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnSiteLinkConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSiteLinkConnectionsResult.class); + + /* + * List of VpnSiteLinkConnections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSiteLinkConnections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSiteLinkConnections. + * + * @param value the value value to set. + * @return the ListVpnSiteLinkConnectionsResult object itself. + */ + public ListVpnSiteLinkConnectionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSiteLinkConnectionsResult object itself. + */ + public ListVpnSiteLinkConnectionsResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java new file mode 100644 index 0000000000000..8a89c456cb834 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks and a URL nextLink to get the next set + * of results. + */ +@Fluent +public final class ListVpnSiteLinksResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSiteLinksResult.class); + + /* + * List of VpnSitesLinks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSitesLinks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSitesLinks. + * + * @param value the value value to set. + * @return the ListVpnSiteLinksResult object itself. + */ + public ListVpnSiteLinksResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSiteLinksResult object itself. + */ + public ListVpnSiteLinksResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java new file mode 100644 index 0000000000000..e81077933eefa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink to get the next set of + * results. + */ +@Fluent +public final class ListVpnSitesResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListVpnSitesResult.class); + + /* + * List of VpnSites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VpnSites. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnSites. + * + * @param value the value value to set. + * @return the ListVpnSitesResult object itself. + */ + public ListVpnSitesResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the ListVpnSitesResult object itself. + */ + public ListVpnSitesResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java new file mode 100644 index 0000000000000..42c7425fc5ea1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of LoadBalancer. */ +public interface LoadBalancer { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The load balancer SKU. + * + * @return the sku value. + */ + LoadBalancerSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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..22d98052cf824 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerBackendAddressPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Load balancer backend addresses. */ +@Fluent +public final class LoadBalancerBackendAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddress.class); + + /* + * Properties of load balancer backend address pool. + */ + @JsonProperty(value = "properties") + private LoadBalancerBackendAddressPropertiesFormat innerProperties; + + /* + * Name of the backend address. + */ + @JsonProperty(value = "name") + private String name; + + /** + * 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(); + } + + /** + * 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/LoadBalancerBackendAddressPoolListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java new file mode 100644 index 0000000000000..bb7f6e7c1082a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListBackendAddressPool API service call. */ +@Fluent +public final class LoadBalancerBackendAddressPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerBackendAddressPoolListResult.class); + + /* + * A list of backend address pools in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of backend address pools in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of backend address pools in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerBackendAddressPoolListResult object itself. + */ + public LoadBalancerBackendAddressPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java new file mode 100644 index 0000000000000..65371e3c8a5eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerBackendAddressPools. */ +public interface LoadBalancerBackendAddressPools { + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer backed address pools. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer backed address pools. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool. + */ + BackendAddressPool get(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Gets load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String loadBalancerName, String backendAddressPoolName); + + /** + * Deletes the specified load balancer backend address pool. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendAddressPoolName The name of the backend address pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String loadBalancerName, String backendAddressPoolName, Context context); + + /** + * Gets load balancer backend address pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer backend address pool 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..8da3c5a95854d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListFrontendIPConfiguration API service call. */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LoadBalancerFrontendIpConfigurationListResult.class); + + /* + * A list of frontend IP configurations in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of frontend IP configurations in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of frontend IP configurations in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerFrontendIpConfigurationListResult object itself. + */ + public LoadBalancerFrontendIpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java new file mode 100644 index 0000000000000..5b9e8f6d226ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerFrontendIpConfigurations. */ +public interface LoadBalancerFrontendIpConfigurations { + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer frontend IP configurations. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer frontend IP configurations. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration. + */ + FrontendIpConfiguration get(String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName); + + /** + * Gets load balancer frontend IP configuration. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param frontendIpConfigurationName The name of the frontend IP configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer frontend IP configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String frontendIpConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java new file mode 100644 index 0000000000000..b706dd11a4ecf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancers API service call. */ +@Fluent +public final class LoadBalancerListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerListResult.class); + + /* + * A list of load balancers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancers in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancers in a resource group. + * + * @param value the value value to set. + * @return the LoadBalancerListResult object itself. + */ + public LoadBalancerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java new file mode 100644 index 0000000000000..bc0fc2dcf1b46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLoadBalancingRule API service call. */ +@Fluent +public final class LoadBalancerLoadBalancingRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerLoadBalancingRuleListResult.class); + + /* + * A list of load balancing rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancing rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancing rules in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerLoadBalancingRuleListResult object itself. + */ + public LoadBalancerLoadBalancingRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java new file mode 100644 index 0000000000000..f0de5e84c8476 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerLoadBalancingRules. */ +public interface LoadBalancerLoadBalancingRules { + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancing rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancing rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule. + */ + LoadBalancingRule get(String resourceGroupName, String loadBalancerName, String loadBalancingRuleName); + + /** + * Gets the specified load balancer load balancing rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param loadBalancingRuleName The name of the load balancing rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer load balancing rule along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String loadBalancingRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java new file mode 100644 index 0000000000000..bd94e1d9b0d2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerNetworkInterfaces. */ +public interface LoadBalancerNetworkInterfaces { + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets associated load balancer network interfaces. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated load balancer network interfaces. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java new file mode 100644 index 0000000000000..2cfdf21581389 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListOutboundRule API service call. */ +@Fluent +public final class LoadBalancerOutboundRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerOutboundRuleListResult.class); + + /* + * A list of outbound rules in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of outbound rules in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of outbound rules in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerOutboundRuleListResult object itself. + */ + public LoadBalancerOutboundRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java new file mode 100644 index 0000000000000..caa1cc40bc5ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerOutboundRuleProtocol. */ +public final class LoadBalancerOutboundRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol UDP = fromString("Udp"); + + /** Static value All for LoadBalancerOutboundRuleProtocol. */ + public static final LoadBalancerOutboundRuleProtocol ALL = fromString("All"); + + /** + * Creates or finds a LoadBalancerOutboundRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerOutboundRuleProtocol. + */ + @JsonCreator + public static LoadBalancerOutboundRuleProtocol fromString(String name) { + return fromString(name, LoadBalancerOutboundRuleProtocol.class); + } + + /** @return known LoadBalancerOutboundRuleProtocol values. */ + public static Collection values() { + return values(LoadBalancerOutboundRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java new file mode 100644 index 0000000000000..8fc8f3b7da03f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerOutboundRules. */ +public interface LoadBalancerOutboundRules { + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the outbound rules in a load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the outbound rules in a load balancer. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule. + */ + OutboundRule get(String resourceGroupName, String loadBalancerName, String outboundRuleName); + + /** + * Gets the specified load balancer outbound rule. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param outboundRuleName The name of the outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer outbound rule along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String outboundRuleName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java new file mode 100644 index 0000000000000..cecb7ee333d4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListProbe API service call. */ +@Fluent +public final class LoadBalancerProbeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerProbeListResult.class); + + /* + * A list of probes in a load balancer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of probes in a load balancer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of probes in a load balancer. + * + * @param value the value value to set. + * @return the LoadBalancerProbeListResult object itself. + */ + public LoadBalancerProbeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java new file mode 100644 index 0000000000000..aa4b78b469060 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LoadBalancerProbes. */ +public interface LoadBalancerProbes { + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName); + + /** + * Gets all the load balancer probes. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancer probes. + */ + PagedIterable list(String resourceGroupName, String loadBalancerName, Context context); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe. + */ + Probe get(String resourceGroupName, String loadBalancerName, String probeName); + + /** + * Gets load balancer probe. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param probeName The name of the probe. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load balancer probe along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String loadBalancerName, String probeName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java new file mode 100644 index 0000000000000..db61acfe4509e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a load balancer. */ +@Fluent +public final class LoadBalancerSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerSku.class); + + /* + * Name of a load balancer SKU. + */ + @JsonProperty(value = "name") + private LoadBalancerSkuName name; + + /* + * Tier of a load balancer SKU. + */ + @JsonProperty(value = "tier") + private LoadBalancerSkuTier tier; + + /** + * Get the name property: Name of a load balancer SKU. + * + * @return the name value. + */ + public LoadBalancerSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a load balancer SKU. + * + * @param name the name value to set. + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withName(LoadBalancerSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a load balancer SKU. + * + * @return the tier value. + */ + public LoadBalancerSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a load balancer SKU. + * + * @param tier the tier value to set. + * @return the LoadBalancerSku object itself. + */ + public LoadBalancerSku withTier(LoadBalancerSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java new file mode 100644 index 0000000000000..e1db1b1df1d14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerSkuName. */ +public final class LoadBalancerSkuName extends ExpandableStringEnum { + /** Static value Basic for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName BASIC = fromString("Basic"); + + /** Static value Standard for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName STANDARD = fromString("Standard"); + + /** Static value Gateway for LoadBalancerSkuName. */ + public static final LoadBalancerSkuName GATEWAY = fromString("Gateway"); + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuName. + */ + @JsonCreator + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** @return known LoadBalancerSkuName values. */ + public static Collection values() { + return values(LoadBalancerSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java new file mode 100644 index 0000000000000..79e5638e169c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerSkuTier. */ +public final class LoadBalancerSkuTier extends ExpandableStringEnum { + /** Static value Regional for LoadBalancerSkuTier. */ + public static final LoadBalancerSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for LoadBalancerSkuTier. */ + public static final LoadBalancerSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a LoadBalancerSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuTier. + */ + @JsonCreator + public static LoadBalancerSkuTier fromString(String name) { + return fromString(name, LoadBalancerSkuTier.class); + } + + /** @return known LoadBalancerSkuTier values. */ + public static Collection values() { + return values(LoadBalancerSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java new file mode 100644 index 0000000000000..92628e9f2342c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request for a VIP swap. */ +@Fluent +public final class LoadBalancerVipSwapRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancerVipSwapRequest.class); + + /* + * A list of frontend IP configuration resources that should swap VIPs. + */ + @JsonProperty(value = "frontendIPConfigurations") + private List frontendIpConfigurations; + + /** + * Get the frontendIpConfigurations property: A list of frontend IP configuration resources that should swap VIPs. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.frontendIpConfigurations; + } + + /** + * Set the frontendIpConfigurations property: A list of frontend IP configuration resources that should swap VIPs. + * + * @param frontendIpConfigurations the frontendIpConfigurations value to set. + * @return the LoadBalancerVipSwapRequest object itself. + */ + public LoadBalancerVipSwapRequest withFrontendIpConfigurations( + List frontendIpConfigurations) { + this.frontendIpConfigurations = frontendIpConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontendIpConfigurations() != null) { + frontendIpConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java new file mode 100644 index 0000000000000..0b4e465964127 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerVipSwapRequestFrontendIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VIP swap request's frontend IP configuration object. */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfiguration { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(LoadBalancerVipSwapRequestFrontendIpConfiguration.class); + + /* + * 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; + + /** + * 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..675488f739b87 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer. + */ + LoadBalancer getByResourceGroup(String resourceGroupName, String loadBalancerName); + + /** + * Gets the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified load balancer along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String loadBalancerName, String expand, Context context); + + /** + * Gets all the load balancers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the load balancers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the load balancers in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters); + + /** + * Swaps VIPs between two load balancers. + * + * @param location The region where load balancers are located at. + * @param parameters Parameters that define which VIPs should be swapped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapPublicIpAddresses(String location, LoadBalancerVipSwapRequest parameters, Context context); + + /** + * 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..aaaa6c15a2977 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadDistribution. */ +public final class LoadDistribution extends ExpandableStringEnum { + /** Static value Default for LoadDistribution. */ + public static final LoadDistribution DEFAULT = fromString("Default"); + + /** Static value SourceIP for LoadDistribution. */ + public static final LoadDistribution SOURCE_IP = fromString("SourceIP"); + + /** Static value SourceIPProtocol for LoadDistribution. */ + public static final LoadDistribution SOURCE_IPPROTOCOL = fromString("SourceIPProtocol"); + + /** + * Creates or finds a LoadDistribution from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadDistribution. + */ + @JsonCreator + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** @return known LoadDistribution values. */ + public static Collection values() { + return values(LoadDistribution.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java new file mode 100644 index 0000000000000..7010b1cb88633 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import java.util.Map; + +/** An immutable client-side representation of LocalNetworkGateway. */ +public interface LocalNetworkGateway { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner object. + * + * @return the inner object. + */ + LocalNetworkGatewayInner innerModel(); + + /** The entirety of the LocalNetworkGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The LocalNetworkGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the LocalNetworkGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the LocalNetworkGateway definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the LocalNetworkGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the LocalNetworkGateway definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithLocalNetworkAddressSpace, + DefinitionStages.WithGatewayIpAddress, + DefinitionStages.WithFqdn, + DefinitionStages.WithBgpSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + LocalNetworkGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LocalNetworkGateway create(Context context); + } + /** The stage of the LocalNetworkGateway definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the LocalNetworkGateway definition allowing to specify localNetworkAddressSpace. */ + interface WithLocalNetworkAddressSpace { + /** + * Specifies the localNetworkAddressSpace property: Local network site address space.. + * + * @param localNetworkAddressSpace Local network site address space. + * @return the next definition stage. + */ + WithCreate withLocalNetworkAddressSpace(AddressSpace localNetworkAddressSpace); + } + /** The stage of the LocalNetworkGateway definition allowing to specify gatewayIpAddress. */ + interface WithGatewayIpAddress { + /** + * Specifies the gatewayIpAddress property: IP address of local network gateway.. + * + * @param gatewayIpAddress IP address of local network gateway. + * @return the next definition stage. + */ + WithCreate withGatewayIpAddress(String gatewayIpAddress); + } + /** The stage of the LocalNetworkGateway definition allowing to specify fqdn. */ + interface WithFqdn { + /** + * Specifies the fqdn property: FQDN of local network gateway.. + * + * @param fqdn FQDN of local network gateway. + * @return the next definition stage. + */ + WithCreate withFqdn(String fqdn); + } + /** The stage of the LocalNetworkGateway definition allowing to specify bgpSettings. */ + interface WithBgpSettings { + /** + * Specifies the bgpSettings property: Local network gateway's BGP speaker settings.. + * + * @param bgpSettings Local network gateway's BGP speaker settings. + * @return the next definition stage. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + } + /** + * Begins update for the LocalNetworkGateway resource. + * + * @return the stage of resource update. + */ + LocalNetworkGateway.Update update(); + + /** The template for LocalNetworkGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LocalNetworkGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LocalNetworkGateway apply(Context context); + } + /** The LocalNetworkGateway update stages. */ + interface UpdateStages { + /** The stage of the LocalNetworkGateway update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LocalNetworkGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LocalNetworkGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java new file mode 100644 index 0000000000000..afc598d9faf39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListLocalNetworkGateways API service call. */ +@Fluent +public final class LocalNetworkGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalNetworkGatewayListResult.class); + + /* + * A list of local network gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of local network gateways that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of local network gateways that exists in a resource group. + * + * @param value the value value to set. + * @return the LocalNetworkGatewayListResult object itself. + */ + public LocalNetworkGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java new file mode 100644 index 0000000000000..13afeb09898d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LocalNetworkGateways. */ +public interface LocalNetworkGateways { + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group. + */ + LocalNetworkGateway getByResourceGroup(String resourceGroupName, String localNetworkGatewayName); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String localNetworkGatewayName, Context context); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String localNetworkGatewayName); + + /** + * Deletes the specified local network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String localNetworkGatewayName, Context context); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the local network gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the local network gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified local network gateway in a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified local network gateway in a resource group 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..21d787ca0b72a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of logging specification. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * The name of the specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Duration of the blob. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: The name of the specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the specification. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The display name of the specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the specification. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Duration of the blob. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Duration of the blob. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java new file mode 100644 index 0000000000000..d945858cb56a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedRuleEnabledState. */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + @JsonCreator + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** @return known ManagedRuleEnabledState values. */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java new file mode 100644 index 0000000000000..fc3e52826a4da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleGroupOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleGroupOverride.class); + + /* + * The managed rule group to override. + */ + @JsonProperty(value = "ruleGroupName", required = true) + private String ruleGroupName; + + /* + * List of rules that will be disabled. If none specified, all rules in the + * group will be disabled. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the ruleGroupName property: The managed rule group to override. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The managed rule group to override. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be disabled. If none specified, all rules in the group will be + * disabled. + * + * @param rules the rules value to set. + * @return the ManagedRuleGroupOverride object itself. + */ + public ManagedRuleGroupOverride withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java new file mode 100644 index 0000000000000..c5d2ec17dc410 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a managed rule group override setting. */ +@Fluent +public final class ManagedRuleOverride { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleOverride.class); + + /* + * Identifier for the managed rule. + */ + @JsonProperty(value = "ruleId", required = true) + private String ruleId; + + /* + * The state of the managed rule. Defaults to Disabled if not specified. + */ + @JsonProperty(value = "state") + private ManagedRuleEnabledState state; + + /** + * Get the ruleId property: Identifier for the managed rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Identifier for the managed rule. + * + * @param ruleId the ruleId value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the state property: The state of the managed rule. Defaults to Disabled if not specified. + * + * @return the state value. + */ + public ManagedRuleEnabledState state() { + return this.state; + } + + /** + * Set the state property: The state of the managed rule. Defaults to Disabled if not specified. + * + * @param state the state value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withState(ManagedRuleEnabledState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java new file mode 100644 index 0000000000000..4ca997f2a29f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines a managed rule set. */ +@Fluent +public final class ManagedRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRuleSet.class); + + /* + * Defines the rule set type to use. + */ + @JsonProperty(value = "ruleSetType", required = true) + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + @JsonProperty(value = "ruleSetVersion", required = true) + private String ruleSetVersion; + + /* + * Defines the rule group overrides to apply to the rule set. + */ + @JsonProperty(value = "ruleGroupOverrides") + private List ruleGroupOverrides; + + /** + * Get the ruleSetType property: Defines the rule set type to use. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.ruleSetType; + } + + /** + * Set the ruleSetType property: Defines the rule set type to use. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetType(String ruleSetType) { + this.ruleSetType = ruleSetType; + return this; + } + + /** + * Get the ruleSetVersion property: Defines the version of the rule set to use. + * + * @return the ruleSetVersion value. + */ + public String ruleSetVersion() { + return this.ruleSetVersion; + } + + /** + * Set the ruleSetVersion property: Defines the version of the rule set to use. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @return the ruleGroupOverrides value. + */ + public List ruleGroupOverrides() { + return this.ruleGroupOverrides; + } + + /** + * Set the ruleGroupOverrides property: Defines the rule group overrides to apply to the rule set. + * + * @param ruleGroupOverrides the ruleGroupOverrides value to set. + * @return the ManagedRuleSet object itself. + */ + public ManagedRuleSet withRuleGroupOverrides(List ruleGroupOverrides) { + this.ruleGroupOverrides = ruleGroupOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java new file mode 100644 index 0000000000000..9915dc02b0c3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class ManagedRulesDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedRulesDefinition.class); + + /* + * The Exclusions that are applied on the policy. + */ + @JsonProperty(value = "exclusions") + private List exclusions; + + /* + * The managed rule sets that are associated with the policy. + */ + @JsonProperty(value = "managedRuleSets", required = true) + private List managedRuleSets; + + /** + * Get the exclusions property: The Exclusions that are applied on the policy. + * + * @return the exclusions value. + */ + public List exclusions() { + return this.exclusions; + } + + /** + * Set the exclusions property: The Exclusions that are applied on the policy. + * + * @param exclusions the exclusions value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withExclusions(List exclusions) { + this.exclusions = exclusions; + return this; + } + + /** + * Get the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @return the managedRuleSets value. + */ + public List managedRuleSets() { + return this.managedRuleSets; + } + + /** + * Set the managedRuleSets property: The managed rule sets that are associated with the policy. + * + * @param managedRuleSets the managedRuleSets value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withManagedRuleSets(List managedRuleSets) { + this.managedRuleSets = managedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (managedRuleSets() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedRuleSets in model ManagedRulesDefinition")); + } else { + managedRuleSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..9d900406f2fbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public class ManagedServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); + + /* + * The principal id of the system assigned identity. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the resource. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. The type 'None' will remove any identities + * from the virtual machine. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of the system assigned identity. This property will only be + * provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the virtual machine. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java new file mode 100644 index 0000000000000..a5e37259a34c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedServiceIdentityUserAssignedIdentities model. */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentities { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedServiceIdentityUserAssignedIdentities.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java new file mode 100644 index 0000000000000..2f9e9709e0611 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Define match conditions. */ +@Fluent +public final class MatchCondition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchCondition.class); + + /* + * List of match variables. + */ + @JsonProperty(value = "matchVariables", required = true) + private List matchVariables; + + /* + * The operator to be matched. + */ + @JsonProperty(value = "operator", required = true) + private WebApplicationFirewallOperator operator; + + /* + * Whether this is negate condition or not. + */ + @JsonProperty(value = "negationConditon") + private Boolean negationConditon; + + /* + * Match value. + */ + @JsonProperty(value = "matchValues", required = true) + private List matchValues; + + /* + * List of transforms. + */ + @JsonProperty(value = "transforms") + private List transforms; + + /** + * Get the matchVariables property: List of match variables. + * + * @return the matchVariables value. + */ + public List matchVariables() { + return this.matchVariables; + } + + /** + * Set the matchVariables property: List of match variables. + * + * @param matchVariables the matchVariables value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchVariables(List matchVariables) { + this.matchVariables = matchVariables; + return this; + } + + /** + * Get the operator property: The operator to be matched. + * + * @return the operator value. + */ + public WebApplicationFirewallOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The operator to be matched. + * + * @param operator the operator value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withOperator(WebApplicationFirewallOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the negationConditon property: Whether this is negate condition or not. + * + * @return the negationConditon value. + */ + public Boolean negationConditon() { + return this.negationConditon; + } + + /** + * Set the negationConditon property: Whether this is negate condition or not. + * + * @param negationConditon the negationConditon value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withNegationConditon(Boolean negationConditon) { + this.negationConditon = negationConditon; + return this; + } + + /** + * Get the matchValues property: Match value. + * + * @return the matchValues value. + */ + public List matchValues() { + return this.matchValues; + } + + /** + * Set the matchValues property: Match value. + * + * @param matchValues the matchValues value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withMatchValues(List matchValues) { + this.matchValues = matchValues; + return this; + } + + /** + * Get the transforms property: List of transforms. + * + * @return the transforms value. + */ + public List transforms() { + return this.transforms; + } + + /** + * Set the transforms property: List of transforms. + * + * @param transforms the transforms value to set. + * @return the MatchCondition object itself. + */ + public MatchCondition withTransforms(List transforms) { + this.transforms = transforms; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariables() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchVariables in model MatchCondition")); + } else { + matchVariables().forEach(e -> e.validate()); + } + if (operator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValues() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property matchValues in model MatchCondition")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java new file mode 100644 index 0000000000000..730db42f6bdf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Define match variables. */ +@Fluent +public final class MatchVariable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchVariable.class); + + /* + * Match Variable. + */ + @JsonProperty(value = "variableName", required = true) + private WebApplicationFirewallMatchVariable variableName; + + /* + * The selector of match variable. + */ + @JsonProperty(value = "selector") + private String selector; + + /** + * Get the variableName property: Match Variable. + * + * @return the variableName value. + */ + public WebApplicationFirewallMatchVariable variableName() { + return this.variableName; + } + + /** + * Set the variableName property: Match Variable. + * + * @param variableName the variableName value to set. + * @return the MatchVariable object itself. + */ + public MatchVariable withVariableName(WebApplicationFirewallMatchVariable variableName) { + this.variableName = variableName; + return this; + } + + /** + * Get the selector property: The selector of match variable. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: The selector of match variable. + * + * @param selector the selector value to set. + * @return the MatchVariable object itself. + */ + public MatchVariable withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (variableName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property variableName in model MatchVariable")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java new file mode 100644 index 0000000000000..084f69cc4474e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Matched rule. */ +@Fluent +public final class MatchedRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MatchedRule.class); + + /* + * Name of the matched network security rule. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /* + * The network traffic is allowed or denied. Possible values are 'Allow' + * and 'Deny'. + */ + @JsonProperty(value = "action") + private String action; + + /** + * Get the ruleName property: Name of the matched network security rule. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: Name of the matched network security rule. + * + * @param ruleName the ruleName value to set. + * @return the MatchedRule object itself. + */ + public MatchedRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + * + * @param action the action value to set. + * @return the MatchedRule object itself. + */ + public MatchedRule withAction(String action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..3cae35fb447de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of metrics specification. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * The name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Units the metric to be displayed in. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * List of availability. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /* + * Whether regional MDM account enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /* + * Whether gaps would be filled with zeros. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Pattern for the filter of the metric. + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /* + * List of dimensions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Whether the metric is internal. + */ + @JsonProperty(value = "isInternal") + private Boolean isInternal; + + /* + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /* + * The resource Id dimension name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name property: The name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: The description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: The description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Units the metric to be displayed in. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Units the metric to be displayed in. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The aggregation type. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the availabilities property: List of availability. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: List of availability. + * + * @param availabilities the availabilities value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAvailabilities(List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Get the enableRegionalMdmAccount property: Whether regional MDM account enabled. + * + * @return the enableRegionalMdmAccount value. + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set the enableRegionalMdmAccount property: Whether regional MDM account enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the fillGapWithZero property: Whether gaps would be filled with zeros. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Whether gaps would be filled with zeros. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the metricFilterPattern property: Pattern for the filter of the metric. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: Pattern for the filter of the metric. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Get the dimensions property: List of dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: List of dimensions. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the isInternal property: Whether the metric is internal. + * + * @return the isInternal value. + */ + public Boolean isInternal() { + return this.isInternal; + } + + /** + * Set the isInternal property: Whether the metric is internal. + * + * @param isInternal the isInternal value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withIsInternal(Boolean isInternal) { + this.isInternal = isInternal; + return this; + } + + /** + * Get the sourceMdmAccount property: The source MDM account. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the sourceMdmAccount property: The source MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the sourceMdmNamespace property: The source MDM namespace. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: The source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the resourceIdDimensionNameOverride property: The resource Id dimension name override. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: The resource Id dimension name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java new file mode 100644 index 0000000000000..cf4e00c51fd2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NatGateway. */ +public interface NatGateway { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The nat gateway SKU. + * + * @return the sku value. + */ + NatGatewaySku sku(); + + /** + * Gets the zones property: A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner object. + * + * @return the inner object. + */ + NatGatewayInner innerModel(); + + /** The entirety of the NatGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NatGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the NatGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NatGateway definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NatGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NatGateway definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithIdleTimeoutInMinutes, + DefinitionStages.WithPublicIpAddresses, + DefinitionStages.WithPublicIpPrefixes { + /** + * Executes the create request. + * + * @return the created resource. + */ + NatGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NatGateway create(Context context); + } + /** The stage of the NatGateway definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NatGateway definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The nat gateway SKU.. + * + * @param sku The nat gateway SKU. + * @return the next definition stage. + */ + WithCreate withSku(NatGatewaySku sku); + } + /** The stage of the NatGateway definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the zone in which Nat Gateway should + * be deployed.. + * + * @param zones A list of availability zones denoting the zone in which Nat Gateway should be deployed. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the NatGateway definition allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The idle timeout of the nat gateway.. + * + * @param idleTimeoutInMinutes The idle timeout of the nat gateway. + * @return the next definition stage. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the NatGateway definition allowing to specify publicIpAddresses. */ + interface WithPublicIpAddresses { + /** + * Specifies the publicIpAddresses property: An array of public ip addresses associated with the nat gateway + * resource.. + * + * @param publicIpAddresses An array of public ip addresses associated with the nat gateway resource. + * @return the next definition stage. + */ + WithCreate withPublicIpAddresses(List publicIpAddresses); + } + /** The stage of the NatGateway definition allowing to specify publicIpPrefixes. */ + interface WithPublicIpPrefixes { + /** + * Specifies the publicIpPrefixes property: An array of public ip prefixes associated with the nat gateway + * resource.. + * + * @param publicIpPrefixes An array of public ip prefixes associated with the nat gateway resource. + * @return the next definition stage. + */ + WithCreate withPublicIpPrefixes(List publicIpPrefixes); + } + } + /** + * Begins update for the NatGateway resource. + * + * @return the stage of resource update. + */ + NatGateway.Update update(); + + /** The template for NatGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NatGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NatGateway apply(Context context); + } + /** The NatGateway update stages. */ + interface UpdateStages { + /** The stage of the NatGateway update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NatGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NatGateway refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java new file mode 100644 index 0000000000000..c74117cb08403 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNatGateways API service call. */ +@Fluent +public final class NatGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewayListResult.class); + + /* + * A list of Nat Gateways that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of Nat Gateways that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of Nat Gateways that exists in a resource group. + * + * @param value the value value to set. + * @return the NatGatewayListResult object itself. + */ + public NatGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NatGatewayListResult object itself. + */ + public NatGatewayListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java new file mode 100644 index 0000000000000..1943660723ae0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of nat gateway. */ +@Fluent +public final class NatGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatGatewaySku.class); + + /* + * Name of Nat Gateway SKU. + */ + @JsonProperty(value = "name") + private NatGatewaySkuName name; + + /** + * Get the name property: Name of Nat Gateway SKU. + * + * @return the name value. + */ + public NatGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Name of Nat Gateway SKU. + * + * @param name the name value to set. + * @return the NatGatewaySku object itself. + */ + public NatGatewaySku withName(NatGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java new file mode 100644 index 0000000000000..bc30b0f2f1bcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NatGatewaySkuName. */ +public final class NatGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard for NatGatewaySkuName. */ + public static final NatGatewaySkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a NatGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NatGatewaySkuName. + */ + @JsonCreator + public static NatGatewaySkuName fromString(String name) { + return fromString(name, NatGatewaySkuName.class); + } + + /** @return known NatGatewaySkuName values. */ + public static Collection values() { + return values(NatGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java new file mode 100644 index 0000000000000..2909a1b51b883 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NatGateways. */ +public interface NatGateways { + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Deletes the specified nat gateway. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String natGatewayName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group. + */ + NatGateway getByResourceGroup(String resourceGroupName, String natGatewayName); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param natGatewayName The name of the nat gateway. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String natGatewayName, String expand, Context context); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Nat Gateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Nat Gateways in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all nat gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all nat gateways in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified nat gateway in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified nat gateway in a specified resource group 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..4e1c0816b302b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type nat. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NatRule") +@Fluent +public final class NatRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatRule.class); + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * The translated address for this NAT rule. + */ + @JsonProperty(value = "translatedAddress") + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + @JsonProperty(value = "translatedPort") + private String translatedPort; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * The translated FQDN for this NAT rule. + */ + @JsonProperty(value = "translatedFqdn") + private String translatedFqdn; + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NatRule object itself. + */ + public NatRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NatRule object itself. + */ + public NatRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the translatedAddress property: The translated address for this NAT rule. + * + * @return the translatedAddress value. + */ + public String translatedAddress() { + return this.translatedAddress; + } + + /** + * Set the translatedAddress property: The translated address for this NAT rule. + * + * @param translatedAddress the translatedAddress value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedAddress(String translatedAddress) { + this.translatedAddress = translatedAddress; + return this; + } + + /** + * Get the translatedPort property: The translated port for this NAT rule. + * + * @return the translatedPort value. + */ + public String translatedPort() { + return this.translatedPort; + } + + /** + * Set the translatedPort property: The translated port for this NAT rule. + * + * @param translatedPort the translatedPort value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedPort(String translatedPort) { + this.translatedPort = translatedPort; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NatRule object itself. + */ + public NatRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @return the translatedFqdn value. + */ + public String translatedFqdn() { + return this.translatedFqdn; + } + + /** + * Set the translatedFqdn property: The translated FQDN for this NAT rule. + * + * @param translatedFqdn the translatedFqdn value to set. + * @return the NatRule object itself. + */ + public NatRule withTranslatedFqdn(String translatedFqdn) { + this.translatedFqdn = translatedFqdn; + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NatRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..406682b65bbb8 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Individual port mappings for inbound NAT rule created for backend pool. */ +@Fluent +public final class NatRulePortMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NatRulePortMapping.class); + + /* + * 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; + + /** + * 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..5b650f635ac59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NatRules. */ +public interface NatRules { + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource. + */ + VpnGatewayNatRule get(String resourceGroupName, String gatewayName, String natRuleName); + + /** + * Retrieves the details of a nat ruleGet. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String gatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all nat rules for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); + + /** + * Retrieves the details of a nat ruleGet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGatewayNatRule Resource 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..4fc8bf89de0a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters to get network configuration diagnostic. */ +@Fluent +public final class NetworkConfigurationDiagnosticParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticParameters.class); + + /* + * The ID of the target resource to perform network configuration + * diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * Verbosity level. + */ + @JsonProperty(value = "verbosityLevel") + private VerbosityLevel verbosityLevel; + + /* + * List of network configuration diagnostic profiles. + */ + @JsonProperty(value = "profiles", required = true) + private List profiles; + + /** + * Get the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. + * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The ID of the target resource to perform network configuration diagnostic. + * Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param targetResourceId the targetResourceId value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the verbosityLevel property: Verbosity level. + * + * @return the verbosityLevel value. + */ + public VerbosityLevel verbosityLevel() { + return this.verbosityLevel; + } + + /** + * Set the verbosityLevel property: Verbosity level. + * + * @param verbosityLevel the verbosityLevel value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withVerbosityLevel(VerbosityLevel verbosityLevel) { + this.verbosityLevel = verbosityLevel; + return this; + } + + /** + * Get the profiles property: List of network configuration diagnostic profiles. + * + * @return the profiles value. + */ + public List profiles() { + return this.profiles; + } + + /** + * Set the profiles property: List of network configuration diagnostic profiles. + * + * @param profiles the profiles value to set. + * @return the NetworkConfigurationDiagnosticParameters object itself. + */ + public NetworkConfigurationDiagnosticParameters withProfiles(List profiles) { + this.profiles = profiles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model" + + " NetworkConfigurationDiagnosticParameters")); + } + if (profiles() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property profiles in model NetworkConfigurationDiagnosticParameters")); + } else { + profiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java new file mode 100644 index 0000000000000..f60c37c521fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to compare with network configuration. */ +@Fluent +public final class NetworkConfigurationDiagnosticProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticProfile.class); + + /* + * The direction of the traffic. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + @JsonProperty(value = "protocol", required = true) + private String protocol; + + /* + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + @JsonProperty(value = "source", required = true) + private String source; + + /* + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service + * Tag. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * Traffic destination port. Accepted values are '*' and a single port in + * the range (0 - 65535). + */ + @JsonProperty(value = "destinationPort", required = true) + private String destinationPort; + + /** + * Get the direction property: The direction of the traffic. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the traffic. + * + * @param direction the direction value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be verified on. Accepted values are '*', TCP, UDP. + * + * @param protocol the protocol value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + * + * @param source the source value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + * + * @param destination the destination value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the destinationPort property: Traffic destination port. Accepted values are '*' and a single port in the + * range (0 - 65535). + * + * @return the destinationPort value. + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: Traffic destination port. Accepted values are '*' and a single port in the + * range (0 - 65535). + * + * @param destinationPort the destinationPort value to set. + * @return the NetworkConfigurationDiagnosticProfile object itself. + */ + public NetworkConfigurationDiagnosticProfile withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model NetworkConfigurationDiagnosticProfile")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model NetworkConfigurationDiagnosticProfile")); + } + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property source in model NetworkConfigurationDiagnosticProfile")); + } + if (destination() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model NetworkConfigurationDiagnosticProfile")); + } + if (destinationPort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationPort in model NetworkConfigurationDiagnosticProfile")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java new file mode 100644 index 0000000000000..1799950d60ef4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner; +import java.util.List; + +/** An immutable client-side representation of NetworkConfigurationDiagnosticResponse. */ +public interface NetworkConfigurationDiagnosticResponse { + /** + * Gets the results property: List of network configuration diagnostic results. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkConfigurationDiagnosticResponseInner object. + * + * @return the inner object. + */ + NetworkConfigurationDiagnosticResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java new file mode 100644 index 0000000000000..fbdc22bb9a196 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network configuration diagnostic result corresponded to provided traffic query. */ +@Fluent +public final class NetworkConfigurationDiagnosticResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkConfigurationDiagnosticResult.class); + + /* + * Network configuration diagnostic profile. + */ + @JsonProperty(value = "profile") + private NetworkConfigurationDiagnosticProfile profile; + + /* + * Network security group result. + */ + @JsonProperty(value = "networkSecurityGroupResult") + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Get the profile property: Network configuration diagnostic profile. + * + * @return the profile value. + */ + public NetworkConfigurationDiagnosticProfile profile() { + return this.profile; + } + + /** + * Set the profile property: Network configuration diagnostic profile. + * + * @param profile the profile value to set. + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withProfile(NetworkConfigurationDiagnosticProfile profile) { + this.profile = profile; + return this; + } + + /** + * Get the networkSecurityGroupResult property: Network security group result. + * + * @return the networkSecurityGroupResult value. + */ + public NetworkSecurityGroupResult networkSecurityGroupResult() { + return this.networkSecurityGroupResult; + } + + /** + * Set the networkSecurityGroupResult property: Network security group result. + * + * @param networkSecurityGroupResult the networkSecurityGroupResult value to set. + * @return the NetworkConfigurationDiagnosticResult object itself. + */ + public NetworkConfigurationDiagnosticResult withNetworkSecurityGroupResult( + NetworkSecurityGroupResult networkSecurityGroupResult) { + this.networkSecurityGroupResult = networkSecurityGroupResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (profile() != null) { + profile().validate(); + } + if (networkSecurityGroupResult() != null) { + networkSecurityGroupResult().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java new file mode 100644 index 0000000000000..b918645b602fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Network Intent Policy resource. */ +@Fluent +public final class NetworkIntentPolicy extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkIntentPolicy.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the NetworkIntentPolicy object itself. + */ + public NetworkIntentPolicy withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkIntentPolicy withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java new file mode 100644 index 0000000000000..187b256d687ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. */ +@Fluent +public final class NetworkIntentPolicyConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkIntentPolicyConfiguration.class); + + /* + * The name of the Network Intent Policy for storing in target + * subscription. + */ + @JsonProperty(value = "networkIntentPolicyName") + private String networkIntentPolicyName; + + /* + * Source network intent policy. + */ + @JsonProperty(value = "sourceNetworkIntentPolicy") + private NetworkIntentPolicy sourceNetworkIntentPolicy; + + /** + * Get the networkIntentPolicyName property: The name of the Network Intent Policy for storing in target + * subscription. + * + * @return the networkIntentPolicyName value. + */ + public String networkIntentPolicyName() { + return this.networkIntentPolicyName; + } + + /** + * Set the networkIntentPolicyName property: The name of the Network Intent Policy for storing in target + * subscription. + * + * @param networkIntentPolicyName the networkIntentPolicyName value to set. + * @return the NetworkIntentPolicyConfiguration object itself. + */ + public NetworkIntentPolicyConfiguration withNetworkIntentPolicyName(String networkIntentPolicyName) { + this.networkIntentPolicyName = networkIntentPolicyName; + return this; + } + + /** + * Get the sourceNetworkIntentPolicy property: Source network intent policy. + * + * @return the sourceNetworkIntentPolicy value. + */ + public NetworkIntentPolicy sourceNetworkIntentPolicy() { + return this.sourceNetworkIntentPolicy; + } + + /** + * Set the sourceNetworkIntentPolicy property: Source network intent policy. + * + * @param sourceNetworkIntentPolicy the sourceNetworkIntentPolicy value to set. + * @return the NetworkIntentPolicyConfiguration object itself. + */ + public NetworkIntentPolicyConfiguration withSourceNetworkIntentPolicy( + NetworkIntentPolicy sourceNetworkIntentPolicy) { + this.sourceNetworkIntentPolicy = sourceNetworkIntentPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceNetworkIntentPolicy() != null) { + sourceNetworkIntentPolicy().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java new file mode 100644 index 0000000000000..65f4fd297f572 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * Gets the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + Boolean enableIpForwarding(); + + /** + * Gets the hostedWorkloads property: A list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * Gets the dscpConfiguration property: A reference to the dscp configuration to which the network interface is + * linked. + * + * @return the dscpConfiguration value. + */ + SubResource dscpConfiguration(); + + /** + * Gets the resourceGuid property: The resource GUID property of the network interface resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @return the workloadType value. + */ + String workloadType(); + + /** + * Gets the nicType property: Type of Network Interface resource. + * + * @return the nicType value. + */ + NetworkInterfaceNicType nicType(); + + /** + * Gets the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @return the privateLinkService value. + */ + PrivateLinkService privateLinkService(); + + /** + * Gets the migrationPhase property: Migration phase of Network Interface resource. + * + * @return the migrationPhase value. + */ + NetworkInterfaceMigrationPhase migrationPhase(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner object. + * + * @return the inner object. + */ + NetworkInterfaceInner innerModel(); + + /** The entirety of the NetworkInterface definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkInterface definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterface definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkInterface definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkInterface definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkInterface definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithNetworkSecurityGroup, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithEnableAcceleratedNetworking, + DefinitionStages.WithEnableIpForwarding, + DefinitionStages.WithWorkloadType, + DefinitionStages.WithNicType, + DefinitionStages.WithPrivateLinkService, + DefinitionStages.WithMigrationPhase { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterface create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterface create(Context context); + } + /** The stage of the NetworkInterface definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetworkInterface definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the network interface.. + * + * @param extendedLocation The extended location of the network interface. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the NetworkInterface definition allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the NetworkInterface definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: A list of IPConfigurations of the network interface.. + * + * @param ipConfigurations A list of IPConfigurations of the network interface. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the NetworkInterface definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: The DNS settings in network interface.. + * + * @param dnsSettings The DNS settings in network interface. + * @return the next definition stage. + */ + WithCreate withDnsSettings(NetworkInterfaceDnsSettings dnsSettings); + } + /** The stage of the NetworkInterface definition allowing to specify enableAcceleratedNetworking. */ + interface WithEnableAcceleratedNetworking { + /** + * Specifies the enableAcceleratedNetworking property: If the network interface is accelerated networking + * enabled.. + * + * @param enableAcceleratedNetworking If the network interface is accelerated networking enabled. + * @return the next definition stage. + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + /** The stage of the NetworkInterface definition allowing to specify enableIpForwarding. */ + interface WithEnableIpForwarding { + /** + * Specifies the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network + * interface.. + * + * @param enableIpForwarding Indicates whether IP forwarding is enabled on this network interface. + * @return the next definition stage. + */ + WithCreate withEnableIpForwarding(Boolean enableIpForwarding); + } + /** The stage of the NetworkInterface definition allowing to specify workloadType. */ + interface WithWorkloadType { + /** + * Specifies the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @param workloadType WorkloadType of the NetworkInterface for BareMetal resources. + * @return the next definition stage. + */ + WithCreate withWorkloadType(String workloadType); + } + /** The stage of the NetworkInterface definition allowing to specify nicType. */ + interface WithNicType { + /** + * Specifies the nicType property: Type of Network Interface resource.. + * + * @param nicType Type of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withNicType(NetworkInterfaceNicType nicType); + } + /** The stage of the NetworkInterface definition allowing to specify privateLinkService. */ + interface WithPrivateLinkService { + /** + * Specifies the privateLinkService property: Privatelinkservice of the network interface resource.. + * + * @param privateLinkService Privatelinkservice of the network interface resource. + * @return the next definition stage. + */ + WithCreate withPrivateLinkService(PrivateLinkServiceInner privateLinkService); + } + /** The stage of the NetworkInterface definition allowing to specify migrationPhase. */ + interface WithMigrationPhase { + /** + * Specifies the migrationPhase property: Migration phase of Network Interface resource.. + * + * @param migrationPhase Migration phase of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase); + } + } + /** + * Begins update for the NetworkInterface resource. + * + * @return the stage of resource update. + */ + NetworkInterface.Update update(); + + /** The template for NetworkInterface update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterface apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterface apply(Context context); + } + /** The NetworkInterface update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterface update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterface refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterface refresh(Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(); + + /** + * Gets all route tables applied to a network interface. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(); + + /** + * Gets all network security groups applied to a network interface. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java new file mode 100644 index 0000000000000..3370ab355e08a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network interface and its custom security rules. */ +@Fluent +public final class NetworkInterfaceAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceAssociation.class); + + /* + * Network interface ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get the id property: Network interface ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the securityRules property: Collection of custom security rules. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: Collection of custom security rules. + * + * @param securityRules the securityRules value to set. + * @return the NetworkInterfaceAssociation object itself. + */ + public NetworkInterfaceAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java new file mode 100644 index 0000000000000..c4dd58421ac40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS settings of a network interface. */ +@Fluent +public final class NetworkInterfaceDnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceDnsSettings.class); + + /* + * List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to + * azure provided DNS resolution. 'AzureProvidedDNS' value cannot be + * combined with other IPs, it must be the only value in dnsServers + * collection. + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /* + * If the VM that uses this NIC is part of an Availability Set, then this + * list will have the union of all DNS servers from all NICs that are part + * of the Availability Set. This property is what is configured on each of + * those VMs. + */ + @JsonProperty(value = "appliedDnsServers", access = JsonProperty.Access.WRITE_ONLY) + private List appliedDnsServers; + + /* + * Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + */ + @JsonProperty(value = "internalDnsNameLabel") + private String internalDnsNameLabel; + + /* + * Fully qualified DNS name supporting internal communications between VMs + * in the same virtual network. + */ + @JsonProperty(value = "internalFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String internalFqdn; + + /* + * Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by + * concatenating the VM name with the value of internalDomainNameSuffix. + */ + @JsonProperty(value = "internalDomainNameSuffix", access = JsonProperty.Access.WRITE_ONLY) + private String internalDomainNameSuffix; + + /** + * Get the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided + * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in + * dnsServers collection. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided + * DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in + * dnsServers collection. + * + * @param dnsServers the dnsServers value to set. + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the appliedDnsServers property: If the VM that uses this NIC is part of an Availability Set, then this list + * will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what + * is configured on each of those VMs. + * + * @return the appliedDnsServers value. + */ + public List appliedDnsServers() { + return this.appliedDnsServers; + } + + /** + * Get the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + * + * @return the internalDnsNameLabel value. + */ + public String internalDnsNameLabel() { + return this.internalDnsNameLabel; + } + + /** + * Set the internalDnsNameLabel property: Relative DNS name for this NIC used for internal communications between + * VMs in the same virtual network. + * + * @param internalDnsNameLabel the internalDnsNameLabel value to set. + * @return the NetworkInterfaceDnsSettings object itself. + */ + public NetworkInterfaceDnsSettings withInternalDnsNameLabel(String internalDnsNameLabel) { + this.internalDnsNameLabel = internalDnsNameLabel; + return this; + } + + /** + * Get the internalFqdn property: Fully qualified DNS name supporting internal communications between VMs in the + * same virtual network. + * + * @return the internalFqdn value. + */ + public String internalFqdn() { + return this.internalFqdn; + } + + /** + * Get the internalDomainNameSuffix property: Even if internalDnsNameLabel is not specified, a DNS entry is created + * for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of + * internalDomainNameSuffix. + * + * @return the internalDomainNameSuffix value. + */ + public String internalDomainNameSuffix() { + return this.internalDomainNameSuffix; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java new file mode 100644 index 0000000000000..1e78c234dfa18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of NetworkInterfaceIpConfiguration. */ +public interface NetworkInterfaceIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + SubResource gatewayLoadBalancer(); + + /** + * Gets the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value. + */ + List virtualNetworkTaps(); + + /** + * Gets the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @return the applicationGatewayBackendAddressPools value. + */ + List applicationGatewayBackendAddressPools(); + + /** + * Gets the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value. + */ + List loadBalancerBackendAddressPools(); + + /** + * Gets the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value. + */ + List loadBalancerInboundNatRules(); + + /** + * Gets the privateIpAddress property: Private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether this is a primary customer address on the network interface. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + PublicIpAddress publicIpAddress(); + + /** + * Gets the applicationSecurityGroups property: Application security groups in which the IP configuration is + * included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface IP configuration. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java new file mode 100644 index 0000000000000..d200300b1ea07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceIpConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceIpConfigurationListResult.class); + + /* + * A list of ip configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ip configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ip configurations. + * + * @param value the value value to set. + * @return the NetworkInterfaceIpConfigurationListResult object itself. + */ + public NetworkInterfaceIpConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java new file mode 100644 index 0000000000000..6e816224be392 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkConnection properties for the network interface. */ +@Immutable +public final class NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.class); + + /* + * The group ID for current private link connection. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The required member name for current private link connection. + */ + @JsonProperty(value = "requiredMemberName", access = JsonProperty.Access.WRITE_ONLY) + private String requiredMemberName; + + /* + * List of FQDNs for current private link connection. + */ + @JsonProperty(value = "fqdns", access = JsonProperty.Access.WRITE_ONLY) + private List fqdns; + + /** + * Get the groupId property: The group ID for current private link connection. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMemberName property: The required member name for current private link connection. + * + * @return the requiredMemberName value. + */ + public String requiredMemberName() { + return this.requiredMemberName; + } + + /** + * Get the fqdns property: List of FQDNs for current private link connection. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..d3fca2ae94e96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceIpConfigurations. */ +public interface NetworkInterfaceIpConfigurations { + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all ip configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all ip configurations in a network interface. + */ + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration. + */ + NetworkInterfaceIpConfiguration get( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName); + + /** + * Gets the specified network interface ip configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String ipConfigurationName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java new file mode 100644 index 0000000000000..934e3d6fa61ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListNetworkInterface API service call. */ +@Fluent +public final class NetworkInterfaceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceListResult.class); + + /* + * A list of network interfaces in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of network interfaces in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network interfaces in a resource group. + * + * @param value the value value to set. + * @return the NetworkInterfaceListResult object itself. + */ + public NetworkInterfaceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java new file mode 100644 index 0000000000000..3aff432e8be56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list ip configurations API service call. */ +@Fluent +public final class NetworkInterfaceLoadBalancerListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceLoadBalancerListResult.class); + + /* + * A list of load balancers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of load balancers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of load balancers. + * + * @param value the value value to set. + * @return the NetworkInterfaceLoadBalancerListResult object itself. + */ + public NetworkInterfaceLoadBalancerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java new file mode 100644 index 0000000000000..05c19f40b8a33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceLoadBalancers. */ +public interface NetworkInterfaceLoadBalancers { + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * List all load balancers in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java new file mode 100644 index 0000000000000..aceec6031c7b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkInterfaceMigrationPhase. */ +public final class NetworkInterfaceMigrationPhase extends ExpandableStringEnum { + /** Static value None for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase NONE = fromString("None"); + + /** Static value Prepare for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase PREPARE = fromString("Prepare"); + + /** Static value Commit for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase COMMIT = fromString("Commit"); + + /** Static value Abort for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase ABORT = fromString("Abort"); + + /** Static value Committed for NetworkInterfaceMigrationPhase. */ + public static final NetworkInterfaceMigrationPhase COMMITTED = fromString("Committed"); + + /** + * Creates or finds a NetworkInterfaceMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceMigrationPhase. + */ + @JsonCreator + public static NetworkInterfaceMigrationPhase fromString(String name) { + return fromString(name, NetworkInterfaceMigrationPhase.class); + } + + /** @return known NetworkInterfaceMigrationPhase values. */ + public static Collection values() { + return values(NetworkInterfaceMigrationPhase.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java new file mode 100644 index 0000000000000..91ee494b2c426 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkInterfaceNicType. */ +public final class NetworkInterfaceNicType extends ExpandableStringEnum { + /** Static value Standard for NetworkInterfaceNicType. */ + public static final NetworkInterfaceNicType STANDARD = fromString("Standard"); + + /** Static value Elastic for NetworkInterfaceNicType. */ + public static final NetworkInterfaceNicType ELASTIC = fromString("Elastic"); + + /** + * Creates or finds a NetworkInterfaceNicType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceNicType. + */ + @JsonCreator + public static NetworkInterfaceNicType fromString(String name) { + return fromString(name, NetworkInterfaceNicType.class); + } + + /** @return known NetworkInterfaceNicType values. */ + public static Collection values() { + return values(NetworkInterfaceNicType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..fd5c042b0bd5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfacePropertiesFormat.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.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 accelerated networking enabled. + * + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * Gets the enableIpForwarding property: Indicates whether IP forwarding is enabled on this network interface. + * + * @return the enableIpForwarding value. + */ + Boolean enableIpForwarding(); + + /** + * Gets the hostedWorkloads property: A list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value. + */ + List hostedWorkloads(); + + /** + * Gets the dscpConfiguration property: A reference to the dscp configuration to which the network interface is + * linked. + * + * @return the dscpConfiguration value. + */ + SubResource dscpConfiguration(); + + /** + * Gets the resourceGuid property: The resource GUID property of the network interface resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @return the workloadType value. + */ + String workloadType(); + + /** + * Gets the nicType property: Type of Network Interface resource. + * + * @return the nicType value. + */ + NetworkInterfaceNicType nicType(); + + /** + * Gets the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @return the privateLinkService value. + */ + PrivateLinkService privateLinkService(); + + /** + * Gets the migrationPhase property: Migration phase of Network Interface resource. + * + * @return the migrationPhase value. + */ + NetworkInterfaceMigrationPhase migrationPhase(); + + /** + * Gets the 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..7932dd96b8ee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; + +/** An immutable client-side representation of NetworkInterfaceTapConfiguration. */ +public interface NetworkInterfaceTapConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Sub Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the virtualNetworkTap property: The reference to the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value. + */ + VirtualNetworkTap virtualNetworkTap(); + + /** + * Gets the provisioningState property: The provisioning state of the network interface tap configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceTapConfigurationInner innerModel(); + + /** The entirety of the NetworkInterfaceTapConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NetworkInterfaceTapConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkInterfaceTapConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkInterfaceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the next definition stage. + */ + WithCreate withExistingNetworkInterface(String resourceGroupName, String networkInterfaceName); + } + /** + * The stage of the NetworkInterfaceTapConfiguration definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithName, DefinitionStages.WithVirtualNetworkTap { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkInterfaceTapConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkInterfaceTapConfiguration create(Context context); + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the NetworkInterfaceTapConfiguration definition allowing to specify virtualNetworkTap. */ + interface WithVirtualNetworkTap { + /** + * Specifies the virtualNetworkTap property: The reference to the Virtual Network Tap resource.. + * + * @param virtualNetworkTap The reference to the Virtual Network Tap resource. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + } + /** + * Begins update for the NetworkInterfaceTapConfiguration resource. + * + * @return the stage of resource update. + */ + NetworkInterfaceTapConfiguration.Update update(); + + /** The template for NetworkInterfaceTapConfiguration update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithVirtualNetworkTap { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkInterfaceTapConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkInterfaceTapConfiguration apply(Context context); + } + /** The NetworkInterfaceTapConfiguration update stages. */ + interface UpdateStages { + /** The stage of the NetworkInterfaceTapConfiguration update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the NetworkInterfaceTapConfiguration update allowing to specify virtualNetworkTap. */ + interface WithVirtualNetworkTap { + /** + * Specifies the virtualNetworkTap property: The reference to the Virtual Network Tap resource.. + * + * @param virtualNetworkTap The reference to the Virtual Network Tap resource. + * @return the next definition stage. + */ + Update withVirtualNetworkTap(VirtualNetworkTapInner virtualNetworkTap); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkInterfaceTapConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkInterfaceTapConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java new file mode 100644 index 0000000000000..7f451bd496aae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for list tap configurations API service call. */ +@Fluent +public final class NetworkInterfaceTapConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkInterfaceTapConfigurationListResult.class); + + /* + * A list of tap configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of tap configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of tap configurations. + * + * @param value the value value to set. + * @return the NetworkInterfaceTapConfigurationListResult object itself. + */ + public NetworkInterfaceTapConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..aacc87829f6f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaceTapConfigurations. */ +public interface NetworkInterfaceTapConfigurations { + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Deletes the specified tap configuration from the NetworkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface. + */ + NetworkInterfaceTapConfiguration get( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName); + + /** + * Get the specified tap configuration on a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param tapConfigurationName The name of the tap configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkInterfaceName, String tapConfigurationName, Context context); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + PagedIterable list(String resourceGroupName, String networkInterfaceName); + + /** + * Get all Tap configurations in a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Tap configurations in a network interface. + */ + PagedIterable list( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Get the specified tap configuration on a network interface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified tap configuration on a network interface 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..e7c1d76c3bd4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkInterfaces. */ +public interface NetworkInterfaces { + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName); + + /** + * Gets information about all network interfaces in a role instance in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a role instance in a cloud service. + */ + PagedIterable listCloudServiceRoleInstanceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, String roleInstanceName, Context context); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName); + + /** + * Gets all network interfaces in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a cloud service. + */ + PagedIterable listCloudServiceNetworkInterfaces( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service. + */ + NetworkInterface getCloudServiceNetworkInterface( + String resourceGroupName, String cloudServiceName, String roleInstanceName, String networkInterfaceName); + + /** + * Get the specified network interface in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a cloud service along with {@link Response}. + */ + Response getCloudServiceNetworkInterfaceWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String expand, + Context context); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * Deletes the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface. + */ + NetworkInterface getByResourceGroup(String resourceGroupName, String networkInterfaceName); + + /** + * Gets information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkInterfaceName, String expand, Context context); + + /** + * Gets all network interfaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + PagedIterable list(); + + /** + * Gets all network interfaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network interfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName); + + /** + * Gets all route tables applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables applied to a network interface. + */ + EffectiveRouteListResult getEffectiveRouteTable( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName); + + /** + * Gets all network security groups applied to a network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups applied to a network interface. + */ + EffectiveNetworkSecurityGroupListResult listEffectiveNetworkSecurityGroups( + String resourceGroupName, String networkInterfaceName, Context context); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex); + + /** + * Gets information about all network interfaces in a virtual machine in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all network interfaces in a virtual machine in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetVMNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, Context context); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network interfaces in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetNetworkInterfaces( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set. + */ + NetworkInterface getVirtualMachineScaleSetNetworkInterface( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface in a virtual machine scale set along with {@link Response}. + */ + Response getVirtualMachineScaleSetNetworkInterfaceWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String expand, + Context context); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set. + */ + NetworkInterfaceIpConfiguration getVirtualMachineScaleSetIpConfiguration( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Get the specified network interface ip configuration in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the ip configuration. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network interface ip configuration in a virtual machine scale set along with {@link + * Response}. + */ + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String expand, + Context context); + + /** + * Gets information about the specified network interface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified network interface 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/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..aeb3d322b61b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkProfile. */ +public interface NetworkProfile { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner object. + * + * @return the inner object. + */ + NetworkProfileInner innerModel(); + + /** The entirety of the NetworkProfile definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkProfile definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkProfile definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkProfile definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkProfile definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkProfile definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithContainerNetworkInterfaceConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkProfile create(Context context); + } + /** The stage of the NetworkProfile definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetworkProfile definition allowing to specify containerNetworkInterfaceConfigurations. */ + interface WithContainerNetworkInterfaceConfigurations { + /** + * Specifies the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations.. + * + * @param containerNetworkInterfaceConfigurations List of chid container network interface configurations. + * @return the next definition stage. + */ + WithCreate withContainerNetworkInterfaceConfigurations( + List containerNetworkInterfaceConfigurations); + } + } + /** + * Begins update for the NetworkProfile resource. + * + * @return the stage of resource update. + */ + NetworkProfile.Update update(); + + /** The template for NetworkProfile update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkProfile apply(Context context); + } + /** The NetworkProfile update stages. */ + interface UpdateStages { + /** The stage of the NetworkProfile update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkProfile refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java new file mode 100644 index 0000000000000..c280bb2935152 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkProfiles API service call. */ +@Fluent +public final class NetworkProfileListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileListResult.class); + + /* + * A list of network profiles that exist in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of network profiles that exist in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network profiles that exist in a resource group. + * + * @param value the value value to set. + * @return the NetworkProfileListResult object itself. + */ + public NetworkProfileListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkProfileListResult object itself. + */ + public NetworkProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java new file mode 100644 index 0000000000000..308ffdfd32094 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkProfiles. */ +public interface NetworkProfiles { + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Deletes the specified network profile. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the NetworkProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkProfileName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group. + */ + NetworkProfile getByResourceGroup(String resourceGroupName, String networkProfileName); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkProfileName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkProfileName, String expand, Context context); + + /** + * Gets all the network profiles in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the network profiles in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the network profiles in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network profiles in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network profiles in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified network profile in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network profile in a specified resource group 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..08deb665ca8dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Rule of type network. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("NetworkRule") +@Fluent +public final class NetworkRule extends FirewallPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRule.class); + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + @JsonProperty(value = "ipProtocols") + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + @JsonProperty(value = "sourceAddresses") + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + @JsonProperty(value = "destinationAddresses") + private List destinationAddresses; + + /* + * List of destination ports. + */ + @JsonProperty(value = "destinationPorts") + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + @JsonProperty(value = "sourceIpGroups") + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + @JsonProperty(value = "destinationIpGroups") + private List destinationIpGroups; + + /* + * List of destination FQDNs. + */ + @JsonProperty(value = "destinationFqdns") + private List destinationFqdns; + + /** + * Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @return the ipProtocols value. + */ + public List ipProtocols() { + return this.ipProtocols; + } + + /** + * Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols. + * + * @param ipProtocols the ipProtocols value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withIpProtocols(List ipProtocols) { + this.ipProtocols = ipProtocols; + return this; + } + + /** + * Get the sourceAddresses property: List of source IP addresses for this rule. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: List of source IP addresses for this rule. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @return the destinationAddresses value. + */ + public List destinationAddresses() { + return this.destinationAddresses; + } + + /** + * Set the destinationAddresses property: List of destination IP addresses or Service Tags. + * + * @param destinationAddresses the destinationAddresses value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationAddresses(List destinationAddresses) { + this.destinationAddresses = destinationAddresses; + return this; + } + + /** + * Get the destinationPorts property: List of destination ports. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of destination ports. + * + * @param destinationPorts the destinationPorts value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the sourceIpGroups property: List of source IpGroups for this rule. + * + * @return the sourceIpGroups value. + */ + public List sourceIpGroups() { + return this.sourceIpGroups; + } + + /** + * Set the sourceIpGroups property: List of source IpGroups for this rule. + * + * @param sourceIpGroups the sourceIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withSourceIpGroups(List sourceIpGroups) { + this.sourceIpGroups = sourceIpGroups; + return this; + } + + /** + * Get the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @return the destinationIpGroups value. + */ + public List destinationIpGroups() { + return this.destinationIpGroups; + } + + /** + * Set the destinationIpGroups property: List of destination IpGroups for this rule. + * + * @param destinationIpGroups the destinationIpGroups value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationIpGroups(List destinationIpGroups) { + this.destinationIpGroups = destinationIpGroups; + return this; + } + + /** + * Get the destinationFqdns property: List of destination FQDNs. + * + * @return the destinationFqdns value. + */ + public List destinationFqdns() { + return this.destinationFqdns; + } + + /** + * Set the destinationFqdns property: List of destination FQDNs. + * + * @param destinationFqdns the destinationFqdns value to set. + * @return the NetworkRule object itself. + */ + public NetworkRule withDestinationFqdns(List destinationFqdns) { + this.destinationFqdns = destinationFqdns; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetworkRule withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java new file mode 100644 index 0000000000000..7307bec507837 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NetworkSecurityGroup. */ +public interface NetworkSecurityGroup { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner object. + * + * @return the inner object. + */ + NetworkSecurityGroupInner innerModel(); + + /** The entirety of the NetworkSecurityGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkSecurityGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkSecurityGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkSecurityGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkSecurityGroup definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkSecurityGroup definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSecurityRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkSecurityGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkSecurityGroup create(Context context); + } + /** The stage of the NetworkSecurityGroup definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetworkSecurityGroup definition allowing to specify securityRules. */ + interface WithSecurityRules { + /** + * Specifies the securityRules property: A collection of security rules of the network security group.. + * + * @param securityRules A collection of security rules of the network security group. + * @return the next definition stage. + */ + WithCreate withSecurityRules(List securityRules); + } + } + /** + * Begins update for the NetworkSecurityGroup resource. + * + * @return the stage of resource update. + */ + NetworkSecurityGroup.Update update(); + + /** The template for NetworkSecurityGroup update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkSecurityGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkSecurityGroup apply(Context context); + } + /** The NetworkSecurityGroup update stages. */ + interface UpdateStages { + /** The stage of the NetworkSecurityGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkSecurityGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkSecurityGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java new file mode 100644 index 0000000000000..f88aeb631c6c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkSecurityGroups API service call. */ +@Fluent +public final class NetworkSecurityGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupListResult.class); + + /* + * A list of NetworkSecurityGroup resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of NetworkSecurityGroup resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of NetworkSecurityGroup resources. + * + * @param value the value value to set. + * @return the NetworkSecurityGroupListResult object itself. + */ + public NetworkSecurityGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkSecurityGroupListResult object itself. + */ + public NetworkSecurityGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java new file mode 100644 index 0000000000000..0544675b93903 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network configuration diagnostic result corresponded provided traffic query. */ +@Fluent +public final class NetworkSecurityGroupResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityGroupResult.class); + + /* + * The network traffic is allowed or denied. + */ + @JsonProperty(value = "securityRuleAccessResult") + private SecurityRuleAccess securityRuleAccessResult; + + /* + * List of results network security groups diagnostic. + */ + @JsonProperty(value = "evaluatedNetworkSecurityGroups", access = JsonProperty.Access.WRITE_ONLY) + private List evaluatedNetworkSecurityGroups; + + /** + * Get the securityRuleAccessResult property: The network traffic is allowed or denied. + * + * @return the securityRuleAccessResult value. + */ + public SecurityRuleAccess securityRuleAccessResult() { + return this.securityRuleAccessResult; + } + + /** + * Set the securityRuleAccessResult property: The network traffic is allowed or denied. + * + * @param securityRuleAccessResult the securityRuleAccessResult value to set. + * @return the NetworkSecurityGroupResult object itself. + */ + public NetworkSecurityGroupResult withSecurityRuleAccessResult(SecurityRuleAccess securityRuleAccessResult) { + this.securityRuleAccessResult = securityRuleAccessResult; + return this; + } + + /** + * Get the evaluatedNetworkSecurityGroups property: List of results network security groups diagnostic. + * + * @return the evaluatedNetworkSecurityGroups value. + */ + public List evaluatedNetworkSecurityGroups() { + return this.evaluatedNetworkSecurityGroups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (evaluatedNetworkSecurityGroups() != null) { + evaluatedNetworkSecurityGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java new file mode 100644 index 0000000000000..a83f124bae062 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkSecurityGroups. */ +public interface NetworkSecurityGroups { + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group. + */ + NetworkSecurityGroup getByResourceGroup(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkSecurityGroupName, String expand, Context context); + + /** + * Gets all network security groups in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + PagedIterable list(); + + /** + * Gets all network security groups in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network security groups in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified network security group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security group 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..873c94073271a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network security rules evaluation result. */ +@Fluent +public final class NetworkSecurityRulesEvaluationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSecurityRulesEvaluationResult.class); + + /* + * Name of the network security rule. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Value indicating whether protocol is matched. + */ + @JsonProperty(value = "protocolMatched") + private Boolean protocolMatched; + + /* + * Value indicating whether source is matched. + */ + @JsonProperty(value = "sourceMatched") + private Boolean sourceMatched; + + /* + * Value indicating whether source port is matched. + */ + @JsonProperty(value = "sourcePortMatched") + private Boolean sourcePortMatched; + + /* + * Value indicating whether destination is matched. + */ + @JsonProperty(value = "destinationMatched") + private Boolean destinationMatched; + + /* + * Value indicating whether destination port is matched. + */ + @JsonProperty(value = "destinationPortMatched") + private Boolean destinationPortMatched; + + /** + * Get the name property: Name of the network security rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the network security rule. + * + * @param name the name value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocolMatched property: Value indicating whether protocol is matched. + * + * @return the protocolMatched value. + */ + public Boolean protocolMatched() { + return this.protocolMatched; + } + + /** + * Set the protocolMatched property: Value indicating whether protocol is matched. + * + * @param protocolMatched the protocolMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withProtocolMatched(Boolean protocolMatched) { + this.protocolMatched = protocolMatched; + return this; + } + + /** + * Get the sourceMatched property: Value indicating whether source is matched. + * + * @return the sourceMatched value. + */ + public Boolean sourceMatched() { + return this.sourceMatched; + } + + /** + * Set the sourceMatched property: Value indicating whether source is matched. + * + * @param sourceMatched the sourceMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourceMatched(Boolean sourceMatched) { + this.sourceMatched = sourceMatched; + return this; + } + + /** + * Get the sourcePortMatched property: Value indicating whether source port is matched. + * + * @return the sourcePortMatched value. + */ + public Boolean sourcePortMatched() { + return this.sourcePortMatched; + } + + /** + * Set the sourcePortMatched property: Value indicating whether source port is matched. + * + * @param sourcePortMatched the sourcePortMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withSourcePortMatched(Boolean sourcePortMatched) { + this.sourcePortMatched = sourcePortMatched; + return this; + } + + /** + * Get the destinationMatched property: Value indicating whether destination is matched. + * + * @return the destinationMatched value. + */ + public Boolean destinationMatched() { + return this.destinationMatched; + } + + /** + * Set the destinationMatched property: Value indicating whether destination is matched. + * + * @param destinationMatched the destinationMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationMatched(Boolean destinationMatched) { + this.destinationMatched = destinationMatched; + return this; + } + + /** + * Get the destinationPortMatched property: Value indicating whether destination port is matched. + * + * @return the destinationPortMatched value. + */ + public Boolean destinationPortMatched() { + return this.destinationPortMatched; + } + + /** + * Set the destinationPortMatched property: Value indicating whether destination port is matched. + * + * @param destinationPortMatched the destinationPortMatched value to set. + * @return the NetworkSecurityRulesEvaluationResult object itself. + */ + public NetworkSecurityRulesEvaluationResult withDestinationPortMatched(Boolean destinationPortMatched) { + this.destinationPortMatched = destinationPortMatched; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java new file mode 100644 index 0000000000000..337617574459c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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. + * + * @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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner object. + * + * @return the inner object. + */ + NetworkVirtualApplianceInner innerModel(); + + /** The entirety of the NetworkVirtualAppliance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkVirtualAppliance definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkVirtualAppliance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkVirtualAppliance definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithNvaSku, + DefinitionStages.WithBootStrapConfigurationBlobs, + DefinitionStages.WithVirtualHub, + DefinitionStages.WithCloudInitConfigurationBlobs, + DefinitionStages.WithCloudInitConfiguration, + DefinitionStages.WithVirtualApplianceAsn, + DefinitionStages.WithSshPublicKey { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkVirtualAppliance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkVirtualAppliance create(Context context); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The service principal that has read access to cloud-init and config + * blob.. + * + * @param identity The service principal that has read access to cloud-init and config blob. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify nvaSku. */ + interface WithNvaSku { + /** + * Specifies the nvaSku property: Network Virtual Appliance SKU.. + * + * @param nvaSku Network Virtual Appliance SKU. + * @return the next definition stage. + */ + WithCreate withNvaSku(VirtualApplianceSkuProperties nvaSku); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify bootStrapConfigurationBlobs. */ + interface WithBootStrapConfigurationBlobs { + /** + * Specifies the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs.. + * + * @param bootStrapConfigurationBlobs BootStrapConfigurationBlobs storage URLs. + * @return the next definition stage. + */ + WithCreate withBootStrapConfigurationBlobs(List bootStrapConfigurationBlobs); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed.. + * + * @param virtualHub The Virtual Hub where Network Virtual Appliance is being deployed. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify cloudInitConfigurationBlobs. */ + interface WithCloudInitConfigurationBlobs { + /** + * Specifies the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs.. + * + * @param cloudInitConfigurationBlobs CloudInitConfigurationBlob storage URLs. + * @return the next definition stage. + */ + WithCreate withCloudInitConfigurationBlobs(List cloudInitConfigurationBlobs); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify cloudInitConfiguration. */ + interface WithCloudInitConfiguration { + /** + * Specifies the cloudInitConfiguration property: CloudInitConfiguration string in plain text.. + * + * @param cloudInitConfiguration CloudInitConfiguration string in plain text. + * @return the next definition stage. + */ + WithCreate withCloudInitConfiguration(String cloudInitConfiguration); + } + /** The stage of the NetworkVirtualAppliance definition allowing to specify virtualApplianceAsn. */ + interface WithVirtualApplianceAsn { + /** + * Specifies the virtualApplianceAsn property: VirtualAppliance ASN.. + * + * @param virtualApplianceAsn VirtualAppliance ASN. + * @return the next definition stage. + */ + WithCreate withVirtualApplianceAsn(Long virtualApplianceAsn); + } + /** 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); + } + } + /** + * Begins update for the NetworkVirtualAppliance resource. + * + * @return the stage of resource update. + */ + NetworkVirtualAppliance.Update update(); + + /** The template for NetworkVirtualAppliance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkVirtualAppliance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkVirtualAppliance apply(Context context); + } + /** The NetworkVirtualAppliance update stages. */ + interface UpdateStages { + /** The stage of the NetworkVirtualAppliance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkVirtualAppliance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkVirtualAppliance refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java new file mode 100644 index 0000000000000..47e54b5d7ab0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualAppliances API service call. */ +@Fluent +public final class NetworkVirtualApplianceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceListResult.class); + + /* + * List of Network Virtual Appliances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliances. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceListResult object itself. + */ + public NetworkVirtualApplianceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceListResult object itself. + */ + public NetworkVirtualApplianceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java new file mode 100644 index 0000000000000..d8ccfdf5427f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSites API service call. */ +@Fluent +public final class NetworkVirtualApplianceSiteListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSiteListResult.class); + + /* + * List of Network Virtual Appliance sites. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliance sites. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliance sites. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceSiteListResult object itself. + */ + public NetworkVirtualApplianceSiteListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceSiteListResult object itself. + */ + public NetworkVirtualApplianceSiteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.java new file mode 100644 index 0000000000000..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..f9f845538c13c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Instances List of available Sku and instances. */ +@Immutable +public final class NetworkVirtualApplianceSkuInstances { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuInstances.class); + + /* + * Scale Unit. + */ + @JsonProperty(value = "scaleUnit", access = JsonProperty.Access.WRITE_ONLY) + private String scaleUnit; + + /* + * Instance Count. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the scaleUnit property: Scale Unit. + * + * @return the scaleUnit value. + */ + public String scaleUnit() { + return this.scaleUnit; + } + + /** + * Get the instanceCount property: Instance Count. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java new file mode 100644 index 0000000000000..9c8de86a63276 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkVirtualApplianceSkus API service call. */ +@Fluent +public final class NetworkVirtualApplianceSkuListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkVirtualApplianceSkuListResult.class); + + /* + * List of Network Virtual Appliance Skus that are available. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network Virtual Appliance Skus that are available. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network Virtual Appliance Skus that are available. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceSkuListResult object itself. + */ + public NetworkVirtualApplianceSkuListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkVirtualApplianceSkuListResult object itself. + */ + public NetworkVirtualApplianceSkuListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java new file mode 100644 index 0000000000000..058a6f5aa8a70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkVirtualAppliances. */ +public interface NetworkVirtualAppliances { + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Deletes the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkVirtualApplianceName, Context context); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance. + */ + NetworkVirtualAppliance getByResourceGroup(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String expand, Context context); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Network Virtual Appliances in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + PagedIterable list(); + + /** + * Gets all Network Virtual Appliances in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Network Virtual Appliances in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Network Virtual Appliance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Network Virtual Appliance 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..9261eb5c208f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import java.util.Map; + +/** An immutable client-side representation of NetworkWatcher. */ +public interface NetworkWatcher { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner object. + * + * @return the inner object. + */ + NetworkWatcherInner innerModel(); + + /** The entirety of the NetworkWatcher definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NetworkWatcher definition stages. */ + interface DefinitionStages { + /** The first stage of the NetworkWatcher definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NetworkWatcher definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NetworkWatcher definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NetworkWatcher definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkWatcher create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkWatcher create(Context context); + } + /** The stage of the NetworkWatcher definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the NetworkWatcher resource. + * + * @return the stage of resource update. + */ + NetworkWatcher.Update update(); + + /** The template for NetworkWatcher update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkWatcher apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkWatcher apply(Context context); + } + /** The NetworkWatcher update stages. */ + interface UpdateStages { + /** The stage of the NetworkWatcher update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkWatcher refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkWatcher refresh(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Topology getTopology(TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group along with {@link Response}. + */ + Response getTopologyWithResponse(TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow(VerificationIpFlowParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(NextHopParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules(SecurityGroupViewParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting(TroubleshootingParameters parameters, Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult(QueryTroubleshootingParameters parameters, Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration(FlowLogInformationInner parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus(FlowLogStatusParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity(ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity(ConnectivityParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport(AzureReachabilityReportParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders(AvailableProvidersListParameters parameters, Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + NetworkConfigurationDiagnosticParameters parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java new file mode 100644 index 0000000000000..da1202c6cf327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListNetworkWatchers API service call. */ +@Fluent +public final class NetworkWatcherListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkWatcherListResult.class); + + /* + * List of network watcher resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of network watcher resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of network watcher resources. + * + * @param value the value value to set. + * @return the NetworkWatcherListResult object itself. + */ + public NetworkWatcherListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java new file mode 100644 index 0000000000000..97c6ac0ba0cf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; + +/** Resource collection API of NetworkWatchers. */ +public interface NetworkWatchers { + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group. + */ + NetworkWatcher getByResourceGroup(String resourceGroupName, String networkWatcherName); + + /** + * Gets the specified network watcher by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String networkWatcherName, Context context); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String networkWatcherName); + + /** + * Deletes the specified network watcher resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, Context context); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all network watchers by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all network watchers by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + PagedIterable list(); + + /** + * Gets all network watchers by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all network watchers by subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group. + */ + Topology getTopology(String resourceGroupName, String networkWatcherName, TopologyParameters parameters); + + /** + * Gets the current network topology by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the representation of topology. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current network topology by resource group along with {@link Response}. + */ + Response getTopologyWithResponse( + String resourceGroupName, String networkWatcherName, TopologyParameters parameters, Context context); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters); + + /** + * Verify IP flow from the specified VM to a location given the currently configured NSG rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the IP flow to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return results of IP flow verification on the target resource. + */ + VerificationIpFlowResult verifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop(String resourceGroupName, String networkWatcherName, NextHopParameters parameters); + + /** + * Gets the next hop from the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the source and destination endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the next hop from the specified VM. + */ + NextHopResult getNextHop( + String resourceGroupName, String networkWatcherName, NextHopParameters parameters, Context context); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters); + + /** + * Gets the configured and effective security group rules on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters that define the VM to check security groups for. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configured and effective security group rules on the specified VM. + */ + SecurityGroupViewResult getVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters); + + /** + * Initiate troubleshooting on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to troubleshoot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return troubleshooting information gained from specified resource. + */ + TroubleshootingResult getTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters); + + /** + * Get the last completed troubleshooting result on a specified resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the resource to query the troubleshooting result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the last completed troubleshooting result on a specified resource. + */ + TroubleshootingResult getTroubleshootingResult( + String resourceGroupName, + String networkWatcherName, + QueryTroubleshootingParameters parameters, + Context context); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters); + + /** + * Configures flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define the configuration of flow log. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation setFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters); + + /** + * Queries status of flow log and traffic analytics (optional) on a specified resource. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that define a resource to query flow log and traffic analytics (optional) status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the configuration of flow log and traffic analytics (optional). + */ + FlowLogInformation getFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters); + + /** + * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint + * including another VM or an arbitrary remote server. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine how the connectivity check will be performed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information on the connectivity status. + */ + ConnectivityInformation checkConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score + * for internet service providers from a specified location to Azure regions. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that determine Azure reachability report configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure reachability report details. + */ + AzureReachabilityReport getAzureReachabilityReport( + String resourceGroupName, + String networkWatcherName, + AzureReachabilityReportParameters parameters, + Context context); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters); + + /** + * NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet + * service providers for a specified Azure region. + * + * @param resourceGroupName The name of the network watcher resource group. + * @param networkWatcherName The name of the network watcher resource. + * @param parameters Parameters that scope the list of available providers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available countries with details. + */ + AvailableProvidersList listAvailableProviders( + String resourceGroupName, + String networkWatcherName, + AvailableProvidersListParameters parameters, + Context context); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters); + + /** + * Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides + * detailed information on what security rules were applied to a specified traffic flow and the result of evaluating + * these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns + * whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param parameters Parameters to get network configuration diagnostic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return network Configuration Diagnostic data to help customers understand and debug network behavior. + */ + NetworkConfigurationDiagnosticResponse getNetworkConfigurationDiagnostic( + String resourceGroupName, + String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, + Context context); + + /** + * Gets the specified network watcher by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network watcher by resource group 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..2dd0a97d69826 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the source and destination endpoint. */ +@Fluent +public final class NextHopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NextHopParameters.class); + + /* + * The resource identifier of the target resource against which the action + * is to be performed. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The source IP address. + */ + @JsonProperty(value = "sourceIPAddress", required = true) + private String sourceIpAddress; + + /* + * The destination IP address. + */ + @JsonProperty(value = "destinationIPAddress", required = true) + private String destinationIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of the nics, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the targetResourceId property: The resource identifier of the target resource against which the action is to + * be performed. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The resource identifier of the target resource against which the action is to + * be performed. + * + * @param targetResourceId the targetResourceId value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the sourceIpAddress property: The source IP address. + * + * @return the sourceIpAddress value. + */ + public String sourceIpAddress() { + return this.sourceIpAddress; + } + + /** + * Set the sourceIpAddress property: The source IP address. + * + * @param sourceIpAddress the sourceIpAddress value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withSourceIpAddress(String sourceIpAddress) { + this.sourceIpAddress = sourceIpAddress; + return this; + } + + /** + * Get the destinationIpAddress property: The destination IP address. + * + * @return the destinationIpAddress value. + */ + public String destinationIpAddress() { + return this.destinationIpAddress; + } + + /** + * Set the destinationIpAddress property: The destination IP address. + * + * @param destinationIpAddress the destinationIpAddress value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withDestinationIpAddress(String destinationIpAddress) { + this.destinationIpAddress = destinationIpAddress; + return this; + } + + /** + * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * the nics, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value. + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * the nics, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set. + * @return the NextHopParameters object itself. + */ + public NextHopParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model NextHopParameters")); + } + if (sourceIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceIpAddress in model NextHopParameters")); + } + if (destinationIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationIpAddress in model NextHopParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java new file mode 100644 index 0000000000000..296e30f871af7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner; + +/** An immutable client-side representation of NextHopResult. */ +public interface NextHopResult { + /** + * Gets the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + NextHopType nextHopType(); + + /** + * Gets the nextHopIpAddress property: Next hop IP Address. + * + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * Gets the routeTableId property: The resource identifier for the route table associated with the route being + * returned. If the route being returned does not correspond to any user created routes then this field will be the + * string 'System Route'. + * + * @return the routeTableId value. + */ + String routeTableId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NextHopResultInner object. + * + * @return the inner object. + */ + NextHopResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java new file mode 100644 index 0000000000000..0ce8f2c104f07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NextHopType. */ +public final class NextHopType extends ExpandableStringEnum { + /** Static value Internet for NextHopType. */ + public static final NextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for NextHopType. */ + public static final NextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value VirtualNetworkGateway for NextHopType. */ + public static final NextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for NextHopType. */ + public static final NextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value HyperNetGateway for NextHopType. */ + public static final NextHopType HYPER_NET_GATEWAY = fromString("HyperNetGateway"); + + /** Static value None for NextHopType. */ + public static final NextHopType NONE = fromString("None"); + + /** + * Creates or finds a NextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NextHopType. + */ + @JsonCreator + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** @return known NextHopType values. */ + public static Collection values() { + return values(NextHopType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java new file mode 100644 index 0000000000000..430bfb2a67d8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Office365 breakout categories. */ +@Fluent +public final class O365BreakOutCategoryPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(O365BreakOutCategoryPolicies.class); + + /* + * Flag to control allow category. + */ + @JsonProperty(value = "allow") + private Boolean allow; + + /* + * Flag to control optimize category. + */ + @JsonProperty(value = "optimize") + private Boolean optimize; + + /* + * Flag to control default category. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /** + * Get the allow property: Flag to control allow category. + * + * @return the allow value. + */ + public Boolean allow() { + return this.allow; + } + + /** + * Set the allow property: Flag to control allow category. + * + * @param allow the allow value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withAllow(Boolean allow) { + this.allow = allow; + return this; + } + + /** + * Get the optimize property: Flag to control optimize category. + * + * @return the optimize value. + */ + public Boolean optimize() { + return this.optimize; + } + + /** + * Set the optimize property: Flag to control optimize category. + * + * @param optimize the optimize value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withOptimize(Boolean optimize) { + this.optimize = optimize; + return this; + } + + /** + * Get the defaultProperty property: Flag to control default category. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Flag to control default category. + * + * @param defaultProperty the defaultProperty value to set. + * @return the O365BreakOutCategoryPolicies object itself. + */ + public O365BreakOutCategoryPolicies withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java new file mode 100644 index 0000000000000..2c1b7a3d0f828 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Office365 breakout policy. */ +@Fluent +public final class O365PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(O365PolicyProperties.class); + + /* + * Office365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + private O365BreakOutCategoryPolicies breakOutCategories; + + /** + * Get the breakOutCategories property: Office365 breakout categories. + * + * @return the breakOutCategories value. + */ + public O365BreakOutCategoryPolicies breakOutCategories() { + return this.breakOutCategories; + } + + /** + * Set the breakOutCategories property: Office365 breakout categories. + * + * @param breakOutCategories the breakOutCategories value to set. + * @return the O365PolicyProperties object itself. + */ + public O365PolicyProperties withBreakOutCategories(O365BreakOutCategoryPolicies breakOutCategories) { + this.breakOutCategories = breakOutCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (breakOutCategories() != null) { + breakOutCategories().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java new file mode 100644 index 0000000000000..3c37cdd064871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class Office365PolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Office365PolicyProperties.class); + + /* + * Office 365 breakout categories. + */ + @JsonProperty(value = "breakOutCategories") + private BreakOutCategoryPolicies breakOutCategories; + + /** + * Get the breakOutCategories property: Office 365 breakout categories. + * + * @return the breakOutCategories value. + */ + public BreakOutCategoryPolicies breakOutCategories() { + return this.breakOutCategories; + } + + /** + * Set the breakOutCategories property: Office 365 breakout categories. + * + * @param breakOutCategories the breakOutCategories value to set. + * @return the Office365PolicyProperties object itself. + */ + public Office365PolicyProperties withBreakOutCategories(BreakOutCategoryPolicies breakOutCategories) { + this.breakOutCategories = breakOutCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (breakOutCategories() != null) { + breakOutCategories().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java new file mode 100644 index 0000000000000..f0d0f0d2b654a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OfficeTrafficCategory. */ +public final class OfficeTrafficCategory extends ExpandableStringEnum { + /** Static value Optimize for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE = fromString("Optimize"); + + /** Static value OptimizeAndAllow for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory OPTIMIZE_AND_ALLOW = fromString("OptimizeAndAllow"); + + /** Static value All for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory ALL = fromString("All"); + + /** Static value None for OfficeTrafficCategory. */ + public static final OfficeTrafficCategory NONE = fromString("None"); + + /** + * Creates or finds a OfficeTrafficCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding OfficeTrafficCategory. + */ + @JsonCreator + public static OfficeTrafficCategory fromString(String name) { + return fromString(name, OfficeTrafficCategory.class); + } + + /** @return known OfficeTrafficCategory values. */ + public static Collection values() { + return values(OfficeTrafficCategory.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java new file mode 100644 index 0000000000000..4aaa7c0a9b439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: Specification of the service. + * + * @return the serviceSpecification value. + */ + OperationPropertiesFormatServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..f08fc49879b6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft Network. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of the operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft Network. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft Network. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Type of the operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Type of the operation: get, read, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..45683ed66f395 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Network operations. It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of Network operations supported by the Network resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Network operations supported by the Network resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Network operations supported by the Network resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java new file mode 100644 index 0000000000000..e3c3235d1d4cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specification of the service. */ +@Fluent +public final class OperationPropertiesFormatServiceSpecification { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OperationPropertiesFormatServiceSpecification.class); + + /* + * Operation service specification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Operation log specification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: Operation service specification. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Operation service specification. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: Operation log specification. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Operation log specification. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationPropertiesFormatServiceSpecification object itself. + */ + public OperationPropertiesFormatServiceSpecification withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java new file mode 100644 index 0000000000000..a9d02dffcbf94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Network Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Network Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Network operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..368ced613215d --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a column to sort. */ +@Fluent +public final class OrderBy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderBy.class); + + /* + * 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 OrderByOrder order; + + /** + * 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 OrderByOrder 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(OrderByOrder 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/OrderByOrder.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderByOrder.java new file mode 100644 index 0000000000000..705b3f7b1772a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderByOrder.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrderByOrder. */ +public final class OrderByOrder extends ExpandableStringEnum { + /** Static value Ascending for OrderByOrder. */ + public static final OrderByOrder ASCENDING = fromString("Ascending"); + + /** Static value Descending for OrderByOrder. */ + public static final OrderByOrder DESCENDING = fromString("Descending"); + + /** + * Creates or finds a OrderByOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrderByOrder. + */ + @JsonCreator + public static OrderByOrder fromString(String name) { + return fromString(name, OrderByOrder.class); + } + + /** @return known OrderByOrder values. */ + public static Collection values() { + return values(OrderByOrder.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java new file mode 100644 index 0000000000000..5710e019416e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Origin. */ +public final class Origin extends ExpandableStringEnum { + /** Static value Local for Origin. */ + public static final Origin LOCAL = fromString("Local"); + + /** Static value Inbound for Origin. */ + public static final Origin INBOUND = fromString("Inbound"); + + /** Static value Outbound for Origin. */ + public static final Origin OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** @return known Origin values. */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java new file mode 100644 index 0000000000000..8c73537a0ba34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import java.util.List; + +/** An immutable client-side representation of OutboundRule. */ +public interface OutboundRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within the set of outbound rules used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value. + */ + Integer allocatedOutboundPorts(); + + /** + * Gets the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + List frontendIpConfigurations(); + + /** + * Gets the backendAddressPool property: A reference to a pool of DIPs. Outbound traffic is randomly load balanced + * across IPs in the backend IPs. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the provisioningState property: The provisioning state of the outbound rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the protocol property: The protocol for the outbound rule in load balancer. + * + * @return the protocol value. + */ + LoadBalancerOutboundRuleProtocol protocol(); + + /** + * Gets the enableTcpReset property: Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected + * connection termination. This element is only used when the protocol is set to TCP. + * + * @return the enableTcpReset value. + */ + Boolean enableTcpReset(); + + /** + * Gets the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value. + */ + Integer idleTimeoutInMinutes(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner object. + * + * @return the inner object. + */ + OutboundRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java new file mode 100644 index 0000000000000..68febd37f2dbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OutputType. */ +public final class OutputType extends ExpandableStringEnum { + /** Static value Workspace for OutputType. */ + public static final OutputType WORKSPACE = fromString("Workspace"); + + /** + * Creates or finds a OutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputType. + */ + @JsonCreator + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); + } + + /** @return known OutputType values. */ + public static Collection values() { + return values(OutputType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java new file mode 100644 index 0000000000000..fea63addc2c75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Allow to exclude some variable satisfy the condition for the WAF check. */ +@Fluent +public final class OwaspCrsExclusionEntry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OwaspCrsExclusionEntry.class); + + /* + * The variable to be excluded. + */ + @JsonProperty(value = "matchVariable", required = true) + private OwaspCrsExclusionEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify + * which elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selectorMatchOperator", required = true) + private OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which + * elements in the collection this exclusion applies to. + */ + @JsonProperty(value = "selector", required = true) + private String selector; + + /* + * The managed rule sets that are associated with the exclusion. + */ + @JsonProperty(value = "exclusionManagedRuleSets") + private List exclusionManagedRuleSets; + + /** + * 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()); + } + } +} 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..3577a3069cbdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.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 OwaspCrsExclusionEntryMatchVariable. */ +public final class OwaspCrsExclusionEntryMatchVariable + extends ExpandableStringEnum { + /** Static value RequestHeaderNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_HEADER_NAMES = fromString("RequestHeaderNames"); + + /** Static value RequestCookieNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_COOKIE_NAMES = fromString("RequestCookieNames"); + + /** Static value RequestArgNames for OwaspCrsExclusionEntryMatchVariable. */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_ARG_NAMES = fromString("RequestArgNames"); + + /** 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 or finds a OwaspCrsExclusionEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntryMatchVariable. + */ + @JsonCreator + public static OwaspCrsExclusionEntryMatchVariable fromString(String name) { + return fromString(name, OwaspCrsExclusionEntryMatchVariable.class); + } + + /** @return known OwaspCrsExclusionEntryMatchVariable values. */ + public static Collection values() { + return values(OwaspCrsExclusionEntryMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java new file mode 100644 index 0000000000000..4ac543e2bc97f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OwaspCrsExclusionEntrySelectorMatchOperator. */ +public final class OwaspCrsExclusionEntrySelectorMatchOperator + extends ExpandableStringEnum { + /** Static value Equals for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator EQUALS = fromString("Equals"); + + /** Static value Contains for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator CONTAINS = fromString("Contains"); + + /** Static value StartsWith for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator STARTS_WITH = fromString("StartsWith"); + + /** Static value EndsWith for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value EqualsAny for OwaspCrsExclusionEntrySelectorMatchOperator. */ + public static final OwaspCrsExclusionEntrySelectorMatchOperator EQUALS_ANY = fromString("EqualsAny"); + + /** + * Creates or finds a OwaspCrsExclusionEntrySelectorMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntrySelectorMatchOperator. + */ + @JsonCreator + public static OwaspCrsExclusionEntrySelectorMatchOperator fromString(String name) { + return fromString(name, OwaspCrsExclusionEntrySelectorMatchOperator.class); + } + + /** @return known OwaspCrsExclusionEntrySelectorMatchOperator values. */ + public static Collection values() { + return values(OwaspCrsExclusionEntrySelectorMatchOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.java new file mode 100644 index 0000000000000..c8660d03ba69b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.P2SConnectionConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** P2SConnectionConfiguration Resource. */ +@Fluent +public final class P2SConnectionConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SConnectionConfiguration.class); + + /* + * 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; + + /** + * 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 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..be42ce86bcb4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of P2S Vpn connection health request. */ +@Fluent +public final class P2SVpnConnectionHealthRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionHealthRequest.class); + + /* + * The list of p2s vpn user names whose p2s vpn connection detailed health + * to retrieve for. + */ + @JsonProperty(value = "vpnUserNamesFilter") + private List vpnUserNamesFilter; + + /* + * The sas-url to download the P2S Vpn connection health detail. + */ + @JsonProperty(value = "outputBlobSasUrl") + private String outputBlobSasUrl; + + /** + * Get the vpnUserNamesFilter property: The list of p2s vpn user names whose p2s vpn connection detailed health to + * retrieve for. + * + * @return the vpnUserNamesFilter value. + */ + public List vpnUserNamesFilter() { + return this.vpnUserNamesFilter; + } + + /** + * Set the vpnUserNamesFilter property: The list of p2s vpn user names whose p2s vpn connection detailed health to + * retrieve for. + * + * @param vpnUserNamesFilter the vpnUserNamesFilter value to set. + * @return the P2SVpnConnectionHealthRequest object itself. + */ + public P2SVpnConnectionHealthRequest withVpnUserNamesFilter(List vpnUserNamesFilter) { + this.vpnUserNamesFilter = vpnUserNamesFilter; + return this; + } + + /** + * Get the outputBlobSasUrl property: The sas-url to download the P2S Vpn connection health detail. + * + * @return the outputBlobSasUrl value. + */ + public String outputBlobSasUrl() { + return this.outputBlobSasUrl; + } + + /** + * Set the outputBlobSasUrl property: The sas-url to download the P2S Vpn connection health detail. + * + * @param outputBlobSasUrl the outputBlobSasUrl value to set. + * @return the P2SVpnConnectionHealthRequest object itself. + */ + public P2SVpnConnectionHealthRequest withOutputBlobSasUrl(String outputBlobSasUrl) { + this.outputBlobSasUrl = outputBlobSasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java new file mode 100644 index 0000000000000..cfc871367d00e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of p2s vpn connections to be disconnected. */ +@Fluent +public final class P2SVpnConnectionRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnConnectionRequest.class); + + /* + * List of p2s vpn connection Ids. + */ + @JsonProperty(value = "vpnConnectionIds") + private List vpnConnectionIds; + + /** + * Get the vpnConnectionIds property: List of p2s vpn connection Ids. + * + * @return the vpnConnectionIds value. + */ + public List vpnConnectionIds() { + return this.vpnConnectionIds; + } + + /** + * Set the vpnConnectionIds property: List of p2s vpn connection Ids. + * + * @param vpnConnectionIds the vpnConnectionIds value to set. + * @return the P2SVpnConnectionRequest object itself. + */ + public P2SVpnConnectionRequest withVpnConnectionIds(List vpnConnectionIds) { + this.vpnConnectionIds = vpnConnectionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java new file mode 100644 index 0000000000000..0b543854b0344 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of P2SVpnGateway. */ +public interface P2SVpnGateway { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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..075390e942794 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of P2SVpnGateways. */ +public interface P2SVpnGateways { + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String gatewayName, Context context); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Deletes a virtual wan p2s vpn gateway. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, Context context); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the P2SVpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable list(); + + /** + * Lists all the P2SVpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways. + */ + PagedIterable list(Context context); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the p2s vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the P2SVpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource. + */ + P2SVpnGateway reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters); + + /** + * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param parameters Parameters supplied to the generate P2SVpnGateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName); + + /** + * Gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection health of P2S clients of the virtual wan P2SVpnGateway in the specified resource group. + */ + P2SVpnGateway getP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request); + + /** + * Gets the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the P2SVpnGateway. + * @param request Request parameters supplied to get p2s vpn connections detailed health. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sas url to get the connection health detail of P2S clients of the virtual wan P2SVpnGateway in the + * specified resource group. + */ + P2SVpnConnectionHealth getP2SVpnConnectionHealthDetailed( + String resourceGroupName, String gatewayName, P2SVpnConnectionHealthRequest request, Context context); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param p2SVpnGatewayName The name of the P2S Vpn Gateway. + * @param request The parameters are supplied to disconnect p2s vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectP2SVpnConnections( + String resourceGroupName, String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Retrieves the details of a virtual wan p2s vpn gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return p2SVpnGateway Resource 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..bd541a89b794a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class P2SVpnProfileParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnProfileParameters.class); + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the P2SVpnProfileParameters object itself. + */ + public P2SVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java new file mode 100644 index 0000000000000..9eca910f30e0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters that define the create packet capture operation. */ +@Fluent +public final class PacketCapture { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCapture.class); + + /* + * Properties of the packet capture. + */ + @JsonProperty(value = "properties", required = true) + private PacketCaptureParameters innerProperties = new PacketCaptureParameters(); + + /** + * 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 VM is 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 VM is 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 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java new file mode 100644 index 0000000000000..713df1d5ec75c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Filter that is applied to packet capture request. Multiple filters can be applied. */ +@Fluent +public final class PacketCaptureFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureFilter.class); + + /* + * Protocol to be filtered on. + */ + @JsonProperty(value = "protocol") + private PcProtocol protocol; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "localIPAddress") + private String localIpAddress; + + /* + * Local IP Address to be filtered on. Notation: "127.0.0.1" for single + * address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" + * for multiple entries. Multiple ranges not currently supported. Mixing + * ranges with multiple entries not currently supported. Default = null. + */ + @JsonProperty(value = "remoteIPAddress") + private String remoteIpAddress; + + /* + * Local port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "localPort") + private String localPort; + + /* + * Remote port to be filtered on. Notation: "80" for single port + * entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges + * not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + */ + @JsonProperty(value = "remotePort") + private String remotePort; + + /** + * Get the protocol property: Protocol to be filtered on. + * + * @return the protocol value. + */ + public PcProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be filtered on. + * + * @param protocol the protocol value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withProtocol(PcProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the localIpAddress value. + */ + public String localIpAddress() { + return this.localIpAddress; + } + + /** + * Set the localIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param localIpAddress the localIpAddress value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalIpAddress(String localIpAddress) { + this.localIpAddress = localIpAddress; + return this; + } + + /** + * Get the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @return the remoteIpAddress value. + */ + public String remoteIpAddress() { + return this.remoteIpAddress; + } + + /** + * Set the remoteIpAddress property: Local IP Address to be filtered on. Notation: "127.0.0.1" for single address + * entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not + * currently supported. Mixing ranges with multiple entries not currently supported. Default = null. + * + * @param remoteIpAddress the remoteIpAddress value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemoteIpAddress(String remoteIpAddress) { + this.remoteIpAddress = remoteIpAddress; + return this; + } + + /** + * Get the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. + * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + * + * @return the localPort value. + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the localPort property: Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. + * "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not + * currently supported. Default = null. + * + * @param localPort the localPort value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for + * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple + * entries not currently supported. Default = null. + * + * @return the remotePort value. + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remotePort property: Remote port to be filtered on. Notation: "80" for single port entry."80-85" for + * range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple + * entries not currently supported. Default = null. + * + * @param remotePort the remotePort value to set. + * @return the PacketCaptureFilter object itself. + */ + public PacketCaptureFilter withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java new file mode 100644 index 0000000000000..2aa88ccbe49be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of packet capture sessions. */ +@Fluent +public final class PacketCaptureListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureListResult.class); + + /* + * Information about packet capture sessions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Information about packet capture sessions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Information about packet capture sessions. + * + * @param value the value value to set. + * @return the PacketCaptureListResult object itself. + */ + public PacketCaptureListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..eb65823e50456 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import java.util.List; + +/** An immutable client-side representation of PacketCaptureResult. */ +public interface PacketCaptureResult { + /** + * Gets the name property: Name of the packet capture session. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: ID of the packet capture operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 VM is currently supported. + * + * @return the target value. + */ + String target(); + + /** + * Gets the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are + * truncated. + * + * @return the bytesToCapturePerPacket value. + */ + Long bytesToCapturePerPacket(); + + /** + * Gets the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + Long totalBytesPerSession(); + + /** + * Gets the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + Integer timeLimitInSeconds(); + + /** + * Gets the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + PacketCaptureStorageLocation storageLocation(); + + /** + * Gets the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + List filters(); + + /** + * Gets the 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..402b05996f419 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage location for a packet capture session. */ +@Fluent +public final class PacketCaptureStorageLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PacketCaptureStorageLocation.class); + + /* + * The ID of the storage account to save the packet capture session. + * Required if no local file path is provided. + */ + @JsonProperty(value = "storageId") + private String storageId; + + /* + * The URI of the storage path to save the packet capture. Must be a + * well-formed URI describing the location to save the packet capture. + */ + @JsonProperty(value = "storagePath") + private String storagePath; + + /* + * A valid local path on the targeting VM. Must include the name of the + * capture file (*.cap). For linux virtual machine it must start with + * /var/captures. Required if no storage ID is provided, otherwise + * optional. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /** + * Get the storageId property: The ID of the storage account to save the packet capture session. Required if no + * local file path is provided. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The ID of the storage account to save the packet capture session. Required if no + * local file path is provided. + * + * @param storageId the storageId value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @return the storagePath value. + */ + public String storagePath() { + return this.storagePath; + } + + /** + * Set the storagePath property: The URI of the storage path to save the packet capture. Must be a well-formed URI + * describing the location to save the packet capture. + * + * @param storagePath the storagePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Get the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: A valid local path on the targeting VM. Must include the name of the capture file + * (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, + * otherwise optional. + * + * @param filePath the filePath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java new file mode 100644 index 0000000000000..a5b71956aa03d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PacketCaptures. */ +public interface PacketCaptures { + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters); + + /** + * Create and start a packet capture on the specified VM. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param parameters Parameters that define the create packet capture operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about packet capture session. + */ + PacketCaptureResult create( + String resourceGroupName, + String networkWatcherName, + String packetCaptureName, + PacketCapture parameters, + Context context); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name. + */ + PacketCaptureResult get(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Gets a packet capture session by name. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a packet capture session by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Deletes the specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Stops a specified packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the network watcher. + * @param packetCaptureName The name of the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName); + + /** + * Query the status of a running packet capture session. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param packetCaptureName The name given to the packet capture session. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return status of packet capture session. + */ + PacketCaptureQueryStatusResult getStatus( + String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName); + + /** + * Lists all packet capture sessions within the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkWatcherName The name of the Network Watcher resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of packet capture sessions. + */ + PagedIterable list(String resourceGroupName, String networkWatcherName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java new file mode 100644 index 0000000000000..c61081392c247 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcError. */ +public final class PcError extends ExpandableStringEnum { + /** Static value InternalError for PcError. */ + public static final PcError INTERNAL_ERROR = fromString("InternalError"); + + /** Static value AgentStopped for PcError. */ + public static final PcError AGENT_STOPPED = fromString("AgentStopped"); + + /** Static value CaptureFailed for PcError. */ + public static final PcError CAPTURE_FAILED = fromString("CaptureFailed"); + + /** Static value LocalFileFailed for PcError. */ + public static final PcError LOCAL_FILE_FAILED = fromString("LocalFileFailed"); + + /** Static value StorageFailed for PcError. */ + public static final PcError STORAGE_FAILED = fromString("StorageFailed"); + + /** + * Creates or finds a PcError from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcError. + */ + @JsonCreator + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** @return known PcError values. */ + public static Collection values() { + return values(PcError.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java new file mode 100644 index 0000000000000..8e4a7c8b09171 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcProtocol. */ +public final class PcProtocol extends ExpandableStringEnum { + /** Static value TCP for PcProtocol. */ + public static final PcProtocol TCP = fromString("TCP"); + + /** Static value UDP for PcProtocol. */ + public static final PcProtocol UDP = fromString("UDP"); + + /** Static value Any for PcProtocol. */ + public static final PcProtocol ANY = fromString("Any"); + + /** + * Creates or finds a PcProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcProtocol. + */ + @JsonCreator + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** @return known PcProtocol values. */ + public static Collection values() { + return values(PcProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java new file mode 100644 index 0000000000000..eb57e996202cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PcStatus. */ +public final class PcStatus extends ExpandableStringEnum { + /** Static value NotStarted for PcStatus. */ + public static final PcStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for PcStatus. */ + public static final PcStatus RUNNING = fromString("Running"); + + /** Static value Stopped for PcStatus. */ + public static final PcStatus STOPPED = fromString("Stopped"); + + /** Static value Error for PcStatus. */ + public static final PcStatus ERROR = fromString("Error"); + + /** Static value Unknown for PcStatus. */ + public static final PcStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a PcStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcStatus. + */ + @JsonCreator + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** @return known PcStatus values. */ + public static Collection values() { + return values(PcStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java new file mode 100644 index 0000000000000..60c7ab60a7e1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; + +/** An immutable client-side representation of PeerExpressRouteCircuitConnection. */ +public interface PeerExpressRouteCircuitConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @return the expressRouteCircuitPeering value. + */ + SubResource expressRouteCircuitPeering(); + + /** + * Gets the peerExpressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of + * the peered circuit. + * + * @return the peerExpressRouteCircuitPeering value. + */ + SubResource peerExpressRouteCircuitPeering(); + + /** + * Gets the addressPrefix property: /29 IP address space to carve out Customer addresses for tunnels. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + CircuitConnectionStatus circuitConnectionStatus(); + + /** + * Gets the connectionName property: The name of the express route circuit connection resource. + * + * @return the connectionName value. + */ + String connectionName(); + + /** + * Gets the authResourceGuid property: The resource guid of the authorization used for the express route circuit + * connection. + * + * @return the authResourceGuid value. + */ + String authResourceGuid(); + + /** + * Gets the provisioningState property: The provisioning state of the peer express route circuit connection + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner + * object. + * + * @return the inner object. + */ + PeerExpressRouteCircuitConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java new file mode 100644 index 0000000000000..03d8940c2878f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListPeeredConnections API service call retrieves all global reach peer circuit connections that belongs + * to a Private Peering for an ExpressRouteCircuit. + */ +@Fluent +public final class PeerExpressRouteCircuitConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerExpressRouteCircuitConnectionListResult.class); + + /* + * The global reach peer circuit connection associated with Private Peering + * in an ExpressRoute Circuit. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The global reach peer circuit connection associated with Private Peering in an + * ExpressRoute Circuit. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The global reach peer circuit connection associated with Private Peering in an + * ExpressRoute Circuit. + * + * @param value the value value to set. + * @return the PeerExpressRouteCircuitConnectionListResult object itself. + */ + public PeerExpressRouteCircuitConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PeerExpressRouteCircuitConnectionListResult object itself. + */ + public PeerExpressRouteCircuitConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.java new file mode 100644 index 0000000000000..81864347a84e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PeerExpressRouteCircuitConnections. */ +public interface PeerExpressRouteCircuitConnections { + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit. + */ + PeerExpressRouteCircuitConnection get( + String resourceGroupName, String circuitName, String peeringName, String connectionName); + + /** + * Gets the specified Peer Express Route Circuit Connection from the specified express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param connectionName The name of the peer express route circuit connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Peer Express Route Circuit Connection from the specified express route circuit along with + * {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String circuitName, String peeringName, String connectionName, Context context); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName); + + /** + * Gets all global reach peer connections associated with a private peering in an express route circuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all global reach peer connections associated with a private peering in an express route circuit. + */ + PagedIterable list( + String resourceGroupName, String circuitName, String peeringName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java new file mode 100644 index 0000000000000..91f2e917d1a52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Peer routing details. */ +@Immutable +public final class PeerRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerRoute.class); + + /* + * The peer's local address. + */ + @JsonProperty(value = "localAddress", access = JsonProperty.Access.WRITE_ONLY) + private String localAddress; + + /* + * The route's network prefix. + */ + @JsonProperty(value = "network", access = JsonProperty.Access.WRITE_ONLY) + private String network; + + /* + * The route's next hop. + */ + @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) + private String nextHop; + + /* + * The peer this route was learned from. + */ + @JsonProperty(value = "sourcePeer", access = JsonProperty.Access.WRITE_ONLY) + private String sourcePeer; + + /* + * The source this route was learned from. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The route's AS path sequence. + */ + @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) + private String asPath; + + /* + * The route's weight. + */ + @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) + private Integer weight; + + /** + * Get the localAddress property: The peer's local address. + * + * @return the localAddress value. + */ + public String localAddress() { + return this.localAddress; + } + + /** + * Get the network property: The route's network prefix. + * + * @return the network value. + */ + public String network() { + return this.network; + } + + /** + * Get the nextHop property: The route's next hop. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Get the sourcePeer property: The peer this route was learned from. + * + * @return the sourcePeer value. + */ + public String sourcePeer() { + return this.sourcePeer; + } + + /** + * Get the origin property: The source this route was learned from. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the asPath property: The route's AS path sequence. + * + * @return the asPath value. + */ + public String asPath() { + return this.asPath; + } + + /** + * Get the weight property: The route's weight. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java new file mode 100644 index 0000000000000..921e0847e98c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRouteList.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner; +import java.util.List; + +/** An immutable client-side representation of PeerRouteList. */ +public interface PeerRouteList { + /** + * Gets the value property: List of peer routes. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PeerRouteListInner object. + * + * @return the inner object. + */ + PeerRouteListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java new file mode 100644 index 0000000000000..3a701cbc9db5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PfsGroup. */ +public final class PfsGroup extends ExpandableStringEnum { + /** Static value None for PfsGroup. */ + public static final PfsGroup NONE = fromString("None"); + + /** Static value PFS1 for PfsGroup. */ + public static final PfsGroup PFS1 = fromString("PFS1"); + + /** Static value PFS2 for PfsGroup. */ + public static final PfsGroup PFS2 = fromString("PFS2"); + + /** Static value PFS2048 for PfsGroup. */ + public static final PfsGroup PFS2048 = fromString("PFS2048"); + + /** Static value ECP256 for PfsGroup. */ + public static final PfsGroup ECP256 = fromString("ECP256"); + + /** Static value ECP384 for PfsGroup. */ + public static final PfsGroup ECP384 = fromString("ECP384"); + + /** Static value PFS24 for PfsGroup. */ + public static final PfsGroup PFS24 = fromString("PFS24"); + + /** Static value PFS14 for PfsGroup. */ + public static final PfsGroup PFS14 = fromString("PFS14"); + + /** Static value PFSMM for PfsGroup. */ + public static final PfsGroup PFSMM = fromString("PFSMM"); + + /** + * Creates or finds a PfsGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding PfsGroup. + */ + @JsonCreator + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** @return known PfsGroup values. */ + public static Collection values() { + return values(PfsGroup.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java new file mode 100644 index 0000000000000..dfad614fd5c5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines contents of a web application firewall global configuration. */ +@Fluent +public final class PolicySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicySettings.class); + + /* + * The state of the policy. + */ + @JsonProperty(value = "state") + private WebApplicationFirewallEnabledState state; + + /* + * The mode of the policy. + */ + @JsonProperty(value = "mode") + private WebApplicationFirewallMode mode; + + /* + * Whether to allow WAF to check request Body. + */ + @JsonProperty(value = "requestBodyCheck") + private Boolean requestBodyCheck; + + /* + * Maximum request body size in Kb for WAF. + */ + @JsonProperty(value = "maxRequestBodySizeInKb") + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + @JsonProperty(value = "fileUploadLimitInMb") + private Integer fileUploadLimitInMb; + + /** + * Get the state property: The state of the policy. + * + * @return the state value. + */ + public WebApplicationFirewallEnabledState state() { + return this.state; + } + + /** + * Set the state property: The state of the policy. + * + * @param state the state value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withState(WebApplicationFirewallEnabledState state) { + this.state = state; + return this; + } + + /** + * Get the mode property: The mode of the policy. + * + * @return the mode value. + */ + public WebApplicationFirewallMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of the policy. + * + * @param mode the mode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMode(WebApplicationFirewallMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the requestBodyCheck property: Whether to allow WAF to check request Body. + * + * @return the requestBodyCheck value. + */ + public Boolean requestBodyCheck() { + return this.requestBodyCheck; + } + + /** + * Set the requestBodyCheck property: Whether to allow WAF to check request Body. + * + * @param requestBodyCheck the requestBodyCheck value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRequestBodyCheck(Boolean requestBodyCheck) { + this.requestBodyCheck = requestBodyCheck; + return this; + } + + /** + * Get the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @return the maxRequestBodySizeInKb value. + */ + public Integer maxRequestBodySizeInKb() { + return this.maxRequestBodySizeInKb; + } + + /** + * Set the maxRequestBodySizeInKb property: Maximum request body size in Kb for WAF. + * + * @param maxRequestBodySizeInKb the maxRequestBodySizeInKb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withMaxRequestBodySizeInKb(Integer maxRequestBodySizeInKb) { + this.maxRequestBodySizeInKb = maxRequestBodySizeInKb; + return this; + } + + /** + * Get the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @return the fileUploadLimitInMb value. + */ + public Integer fileUploadLimitInMb() { + return this.fileUploadLimitInMb; + } + + /** + * Set the fileUploadLimitInMb property: Maximum file upload size in Mb for WAF. + * + * @param fileUploadLimitInMb the fileUploadLimitInMb value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withFileUploadLimitInMb(Integer fileUploadLimitInMb) { + this.fileUploadLimitInMb = fileUploadLimitInMb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java new file mode 100644 index 0000000000000..eb357189f4b2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreferredIpVersion. */ +public final class PreferredIpVersion extends ExpandableStringEnum { + /** Static value IPv4 for PreferredIpVersion. */ + public static final PreferredIpVersion IPV4 = fromString("IPv4"); + + /** Static value IPv6 for PreferredIpVersion. */ + public static final PreferredIpVersion IPV6 = fromString("IPv6"); + + /** + * Creates or finds a PreferredIpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredIpVersion. + */ + @JsonCreator + public static PreferredIpVersion fromString(String name) { + return fromString(name, PreferredIpVersion.class); + } + + /** @return known PreferredIpVersion values. */ + public static Collection values() { + return values(PreferredIpVersion.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java new file mode 100644 index 0000000000000..68b8a9c89a2fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreferredRoutingGateway. */ +public final class PreferredRoutingGateway extends ExpandableStringEnum { + /** Static value ExpressRoute for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VpnGateway for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway VPN_GATEWAY = fromString("VpnGateway"); + + /** Static value None for PreferredRoutingGateway. */ + public static final PreferredRoutingGateway NONE = fromString("None"); + + /** + * Creates or finds a PreferredRoutingGateway from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredRoutingGateway. + */ + @JsonCreator + public static PreferredRoutingGateway fromString(String name) { + return fromString(name, PreferredRoutingGateway.class); + } + + /** @return known PreferredRoutingGateway values. */ + public static Collection values() { + return values(PreferredRoutingGateway.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java new file mode 100644 index 0000000000000..a03604d63422d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of PrepareNetworkPolicies for Subnet. */ +@Fluent +public final class PrepareNetworkPoliciesRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrepareNetworkPoliciesRequest.class); + + /* + * The name of the service for which subnet is being prepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /* + * A list of NetworkIntentPolicyConfiguration. + */ + @JsonProperty(value = "networkIntentPolicyConfigurations") + private List networkIntentPolicyConfigurations; + + /** + * Get the serviceName property: The name of the service for which subnet is being prepared for. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service for which subnet is being prepared for. + * + * @param serviceName the serviceName value to set. + * @return the PrepareNetworkPoliciesRequest object itself. + */ + public PrepareNetworkPoliciesRequest withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the networkIntentPolicyConfigurations property: A list of NetworkIntentPolicyConfiguration. + * + * @return the networkIntentPolicyConfigurations value. + */ + public List networkIntentPolicyConfigurations() { + return this.networkIntentPolicyConfigurations; + } + + /** + * Set the networkIntentPolicyConfigurations property: A list of NetworkIntentPolicyConfiguration. + * + * @param networkIntentPolicyConfigurations the networkIntentPolicyConfigurations value to set. + * @return the PrepareNetworkPoliciesRequest object itself. + */ + public PrepareNetworkPoliciesRequest withNetworkIntentPolicyConfigurations( + List networkIntentPolicyConfigurations) { + this.networkIntentPolicyConfigurations = networkIntentPolicyConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkIntentPolicyConfigurations() != null) { + networkIntentPolicyConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java new file mode 100644 index 0000000000000..34cbd7ddf5355 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZonePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateDnsZoneConfig resource. */ +@Fluent +public final class PrivateDnsZoneConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneConfig.class); + + /* + * Name of the resource that is unique within a resource group. This name + * can be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties of the private dns zone configuration. + */ + @JsonProperty(value = "properties") + private PrivateDnsZonePropertiesFormat 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 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..e179eb63729ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateDnsZoneGroups API service call. */ +@Fluent +public final class PrivateDnsZoneGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateDnsZoneGroupListResult.class); + + /* + * A list of private dns zone group resources in a private endpoint. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of private dns zone group resources in a private endpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of private dns zone group resources in a private endpoint. + * + * @param value the value value to set. + * @return the PrivateDnsZoneGroupListResult object itself. + */ + public PrivateDnsZoneGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java new file mode 100644 index 0000000000000..cc2f825e82e98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; + +/** Resource collection API of PrivateDnsZoneGroups. */ +public interface PrivateDnsZoneGroups { + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Deletes the specified private dns zone group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name. + */ + PrivateDnsZoneGroup get(String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName); + + /** + * Gets the private dns zone group resource by specified private dns zone group name. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private dns zone group resource by specified private dns zone group name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, Context context); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters); + + /** + * Creates or updates a private dns zone group in the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param privateDnsZoneGroupName The name of the private dns zone group. + * @param parameters Parameters supplied to the create or update private dns zone group operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private dns zone group resource. + */ + PrivateDnsZoneGroup createOrUpdate( + String resourceGroupName, + String privateEndpointName, + String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, + Context context); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + PagedIterable list(String privateEndpointName, String resourceGroupName); + + /** + * Gets all private dns zone groups in a private endpoint. + * + * @param privateEndpointName The name of the private endpoint. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private dns zone groups in a private endpoint. + */ + PagedIterable list(String privateEndpointName, String resourceGroupName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..5c5885244a5ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.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.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 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..40159279d4b0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpointConnection API service call. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * A list of PrivateEndpointConnection resources for a specific private + * link service. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of PrivateEndpointConnection resources for a specific private link service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of PrivateEndpointConnection resources for a specific private link service. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..aafd88b72284e --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An IP Configuration of the private endpoint. */ +@Fluent +public final class PrivateEndpointIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointIpConfiguration.class); + + /* + * 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; + + /** + * 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..fe7bf8b71993d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateEndpoints API service call. */ +@Fluent +public final class PrivateEndpointListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointListResult.class); + + /* + * A list of private endpoint resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of private endpoint resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of private endpoint resources in a resource group. + * + * @param value the value value to set. + * @return the PrivateEndpointListResult object itself. + */ + public PrivateEndpointListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..fa71efce9c043 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpoints. */ +public interface PrivateEndpoints { + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Deletes the specified private endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateEndpointName, Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group. + */ + PrivateEndpoint getByResourceGroup(String resourceGroupName, String privateEndpointName); + + /** + * Gets the specified private endpoint by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param privateEndpointName The name of the private endpoint. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateEndpointName, String expand, Context context); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private endpoints in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private endpoints in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + PagedIterable list(); + + /** + * Gets all private endpoints in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private endpoints in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified private endpoint by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint by resource group 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..627c8002bf86c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PrivateLinkService. */ +public interface PrivateLinkService { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the load balancer. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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..65df356a30545 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** PrivateLinkServiceConnection resource. */ +@Fluent +public final class PrivateLinkServiceConnection extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnection.class); + + /* + * 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; + + /** + * 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..f16ac8ad1a7a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java new file mode 100644 index 0000000000000..c854b99fbd21f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner; + +/** An immutable client-side representation of PrivateLinkServiceIpConfiguration. */ +public interface PrivateLinkServiceIpConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of private link service ip configuration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + IpAllocationMethod privateIpAllocationMethod(); + + /** + * Gets the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + Subnet subnet(); + + /** + * Gets the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + Boolean primary(); + + /** + * Gets the provisioningState property: The provisioning state of the private link service IP configuration + * resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateIpAddressVersion property: Whether the specific IP configuration is IPv4 or IPv6. Default is + * IPv4. + * + * @return the privateIpAddressVersion value. + */ + IpVersion privateIpAddressVersion(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceIpConfigurationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..7a1b9706ec2c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListPrivateLinkService API service call. */ +@Fluent +public final class PrivateLinkServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceListResult.class); + + /* + * A list of PrivateLinkService resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of PrivateLinkService resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of PrivateLinkService resources in a resource group. + * + * @param value the value value to set. + * @return the PrivateLinkServiceListResult object itself. + */ + public PrivateLinkServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java new file mode 100644 index 0000000000000..6f061d8d6deae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The auto-approval list of the private link service. */ +@Fluent +public final class PrivateLinkServicePropertiesAutoApproval extends ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicePropertiesAutoApproval.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkServicePropertiesAutoApproval withSubscriptions(List subscriptions) { + super.withSubscriptions(subscriptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java new file mode 100644 index 0000000000000..fcc5fe9774b11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** The visibility list of the private link service. */ +@Fluent +public final class PrivateLinkServicePropertiesVisibility extends ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServicePropertiesVisibility.class); + + /** {@inheritDoc} */ + @Override + public PrivateLinkServicePropertiesVisibility withSubscriptions(List subscriptions) { + super.withSubscriptions(subscriptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java new file mode 100644 index 0000000000000..0c660c4e70e12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner; + +/** An immutable client-side representation of PrivateLinkServiceVisibility. */ +public interface PrivateLinkServiceVisibility { + /** + * Gets the visible property: Private Link Service Visibility (True/False). + * + * @return the visible value. + */ + Boolean visible(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceVisibilityInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceVisibilityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java new file mode 100644 index 0000000000000..6ccdbbbb611eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of PrivateLinkServices. */ +public interface PrivateLinkServices { + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Deletes the specified private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, Context context); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group. + */ + PrivateLinkService getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets the specified private link service by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, String expand, Context context); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all private link services in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link services in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all private link service in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + PagedIterable list(); + + /** + * Gets all private link service in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link service in a subscription. + */ + PagedIterable list(Context context); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group. + */ + PrivateEndpointConnection getPrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Get the specific private end point connection by specific private link service in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific private end point connection by specific private link service in the resource group along + * with {@link Response}. + */ + Response getPrivateEndpointConnectionWithResponse( + String resourceGroupName, String serviceName, String peConnectionName, String expand, Context context); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource. + */ + PrivateEndpointConnection updatePrivateEndpointConnection( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param parameters Parameters supplied to approve or reject the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return privateEndpointConnection resource along with {@link Response}. + */ + Response updatePrivateEndpointConnectionWithResponse( + String resourceGroupName, + String serviceName, + String peConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePrivateEndpointConnection(String resourceGroupName, String serviceName, String peConnectionName); + + /** + * Delete private end point connection for a private link service in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param peConnectionName The name of the private end point connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePrivateEndpointConnection( + String resourceGroupName, String serviceName, String peConnectionName, Context context); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName); + + /** + * Gets all private end point connections for a specific private link service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the private link service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private end point connections for a specific private link service. + */ + PagedIterable listPrivateEndpointConnections( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service. + * + * @param location The location of the domain name. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibility( + String location, CheckPrivateLinkServiceVisibilityRequest parameters, Context context); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, String resourceGroupName, CheckPrivateLinkServiceVisibilityRequest parameters); + + /** + * Checks whether the subscription is visible to private link service in the specified resource group. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param parameters The request body of CheckPrivateLinkService API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckPrivateLinkServiceVisibility API service call. + */ + PrivateLinkServiceVisibility checkPrivateLinkServiceVisibilityByResourceGroup( + String location, + String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, + Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServices(String location); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServices(String location, Context context); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName); + + /** + * Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this + * subscription in this region. + * + * @param location The location of the domain name. + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved. + */ + PagedIterable listAutoApprovedPrivateLinkServicesByResourceGroup( + String location, String resourceGroupName, Context context); + + /** + * Gets the specified private link service by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private link service by resource group 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..d110518ef8481 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import java.util.List; + +/** An immutable client-side representation of Probe. */ +public interface Probe { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within the set of probes used by the load + * balancer. This name can be used to access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the loadBalancingRules property: The load balancer rules that use this probe. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the protocol property: The protocol of the end point. If 'Tcp' is specified, a received ACK is required for + * the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is + * required for the probe to be successful. + * + * @return the protocol value. + */ + ProbeProtocol protocol(); + + /** + * Gets the port property: The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + * + * @return the port value. + */ + 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 requestPath property: The URI used for requesting health status from the VM. Path is required if a + * protocol is set to http. Otherwise, it is not allowed. There is no default value. + * + * @return the requestPath value. + */ + String requestPath(); + + /** + * Gets the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ProbeInner object. + * + * @return the inner object. + */ + ProbeInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java new file mode 100644 index 0000000000000..0f332b3e59200 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProbeProtocol. */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value Http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("Http"); + + /** Static value Tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("Tcp"); + + /** Static value Https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("Https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeProtocol. + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** @return known ProbeProtocol values. */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java new file mode 100644 index 0000000000000..7c080e88baa05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProcessorArchitecture. */ +public final class ProcessorArchitecture extends ExpandableStringEnum { + /** Static value Amd64 for ProcessorArchitecture. */ + public static final ProcessorArchitecture AMD64 = fromString("Amd64"); + + /** Static value X86 for ProcessorArchitecture. */ + public static final ProcessorArchitecture X86 = fromString("X86"); + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProcessorArchitecture. + */ + @JsonCreator + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** @return known ProcessorArchitecture values. */ + public static Collection values() { + return values(ProcessorArchitecture.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java new file mode 100644 index 0000000000000..9dbd335e0c0ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of RouteTables to advertise the routes to. */ +@Fluent +public final class PropagatedRouteTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PropagatedRouteTable.class); + + /* + * The list of labels. + */ + @JsonProperty(value = "labels") + private List labels; + + /* + * The list of resource ids of all the RouteTables. + */ + @JsonProperty(value = "ids") + private List ids; + + /** + * Get the labels property: The list of labels. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: The list of labels. + * + * @param labels the labels value to set. + * @return the PropagatedRouteTable object itself. + */ + public PropagatedRouteTable withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the ids property: The list of resource ids of all the RouteTables. + * + * @return the ids value. + */ + public List ids() { + return this.ids; + } + + /** + * Set the ids property: The list of resource ids of all the RouteTables. + * + * @param ids the ids value to set. + * @return the PropagatedRouteTable object itself. + */ + public PropagatedRouteTable withIds(List ids) { + this.ids = ids; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java new file mode 100644 index 0000000000000..1d4494e933e33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value Tcp for Protocol. */ + public static final Protocol TCP = fromString("Tcp"); + + /** Static value Http for Protocol. */ + public static final Protocol HTTP = fromString("Http"); + + /** Static value Https for Protocol. */ + public static final Protocol HTTPS = fromString("Https"); + + /** Static value Icmp for Protocol. */ + public static final Protocol ICMP = fromString("Icmp"); + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java new file mode 100644 index 0000000000000..4adbd0b788a64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration of the protocol. */ +@Fluent +public final class ProtocolConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolConfiguration.class); + + /* + * HTTP configuration of the connectivity check. + */ + @JsonProperty(value = "HTTPConfiguration") + private HttpConfiguration httpConfiguration; + + /** + * Get the httpConfiguration property: HTTP configuration of the connectivity check. + * + * @return the httpConfiguration value. + */ + public HttpConfiguration httpConfiguration() { + return this.httpConfiguration; + } + + /** + * Set the httpConfiguration property: HTTP configuration of the connectivity check. + * + * @param httpConfiguration the httpConfiguration value to set. + * @return the ProtocolConfiguration object itself. + */ + public ProtocolConfiguration withHttpConfiguration(HttpConfiguration httpConfiguration) { + this.httpConfiguration = httpConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpConfiguration() != null) { + httpConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java new file mode 100644 index 0000000000000..bd593e1dc3653 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolCustomSettingsFormat.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** DDoS custom policy properties. */ +@Fluent +public final class ProtocolCustomSettingsFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolCustomSettingsFormat.class); + + /* + * The protocol for which the DDoS protection policy is being customized. + */ + @JsonProperty(value = "protocol") + private DdosCustomPolicyProtocol protocol; + + /* + * The customized DDoS protection trigger rate. + */ + @JsonProperty(value = "triggerRateOverride") + private String triggerRateOverride; + + /* + * The customized DDoS protection source rate. + */ + @JsonProperty(value = "sourceRateOverride") + private String sourceRateOverride; + + /* + * The customized DDoS protection trigger rate sensitivity degrees. High: + * Trigger rate set with most sensitivity w.r.t. normal traffic. Default: + * Trigger rate set with moderate sensitivity w.r.t. normal traffic. Low: + * Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + */ + @JsonProperty(value = "triggerSensitivityOverride") + private DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride; + + /** + * Get the protocol property: The protocol for which the DDoS protection policy is being customized. + * + * @return the protocol value. + */ + public DdosCustomPolicyProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol for which the DDoS protection policy is being customized. + * + * @param protocol the protocol value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withProtocol(DdosCustomPolicyProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the triggerRateOverride property: The customized DDoS protection trigger rate. + * + * @return the triggerRateOverride value. + */ + public String triggerRateOverride() { + return this.triggerRateOverride; + } + + /** + * Set the triggerRateOverride property: The customized DDoS protection trigger rate. + * + * @param triggerRateOverride the triggerRateOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withTriggerRateOverride(String triggerRateOverride) { + this.triggerRateOverride = triggerRateOverride; + return this; + } + + /** + * Get the sourceRateOverride property: The customized DDoS protection source rate. + * + * @return the sourceRateOverride value. + */ + public String sourceRateOverride() { + return this.sourceRateOverride; + } + + /** + * Set the sourceRateOverride property: The customized DDoS protection source rate. + * + * @param sourceRateOverride the sourceRateOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withSourceRateOverride(String sourceRateOverride) { + this.sourceRateOverride = sourceRateOverride; + return this; + } + + /** + * Get the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. + * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate + * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + * + * @return the triggerSensitivityOverride value. + */ + public DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride() { + return this.triggerSensitivityOverride; + } + + /** + * Set the triggerSensitivityOverride property: The customized DDoS protection trigger rate sensitivity degrees. + * High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate + * sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: + * Trigger rate set with least sensitivity w.r.t. normal traffic. + * + * @param triggerSensitivityOverride the triggerSensitivityOverride value to set. + * @return the ProtocolCustomSettingsFormat object itself. + */ + public ProtocolCustomSettingsFormat withTriggerSensitivityOverride( + DdosCustomPolicyTriggerSensitivityOverride triggerSensitivityOverride) { + this.triggerSensitivityOverride = triggerSensitivityOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java new file mode 100644 index 0000000000000..f6a7be29d8418 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProtocolType. */ +public final class ProtocolType extends ExpandableStringEnum { + /** Static value DoNotUse for ProtocolType. */ + public static final ProtocolType DO_NOT_USE = fromString("DoNotUse"); + + /** Static value Icmp for ProtocolType. */ + public static final ProtocolType ICMP = fromString("Icmp"); + + /** Static value Tcp for ProtocolType. */ + public static final ProtocolType TCP = fromString("Tcp"); + + /** Static value Udp for ProtocolType. */ + public static final ProtocolType UDP = fromString("Udp"); + + /** Static value Gre for ProtocolType. */ + public static final ProtocolType GRE = fromString("Gre"); + + /** Static value Esp for ProtocolType. */ + public static final ProtocolType ESP = fromString("Esp"); + + /** Static value Ah for ProtocolType. */ + public static final ProtocolType AH = fromString("Ah"); + + /** Static value Vxlan for ProtocolType. */ + public static final ProtocolType VXLAN = fromString("Vxlan"); + + /** Static value All for ProtocolType. */ + public static final ProtocolType ALL = fromString("All"); + + /** + * Creates or finds a ProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolType. + */ + @JsonCreator + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** @return known ProtocolType values. */ + public static Collection values() { + return values(ProtocolType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..997eceaebcc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java new file mode 100644 index 0000000000000..82b0c52a7978e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PublicIpAddress. */ +public interface PublicIpAddress { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The public IP address SKU. + * + * @return the sku value. + */ + PublicIpAddressSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner object. + * + * @return the inner object. + */ + PublicIpAddressInner innerModel(); + + /** The entirety of the PublicIpAddress definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PublicIpAddress definition stages. */ + interface DefinitionStages { + /** The first stage of the PublicIpAddress definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PublicIpAddress definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PublicIpAddress definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PublicIpAddress definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithPublicIpAllocationMethod, + DefinitionStages.WithPublicIpAddressVersion, + DefinitionStages.WithDnsSettings, + DefinitionStages.WithDdosSettings, + DefinitionStages.WithIpTags, + DefinitionStages.WithIpAddress, + DefinitionStages.WithPublicIpPrefix, + DefinitionStages.WithIdleTimeoutInMinutes, + DefinitionStages.WithServicePublicIpAddress, + DefinitionStages.WithNatGateway, + DefinitionStages.WithMigrationPhase, + DefinitionStages.WithLinkedPublicIpAddress, + DefinitionStages.WithDeleteOption { + /** + * Executes the create request. + * + * @return the created resource. + */ + PublicIpAddress create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PublicIpAddress create(Context context); + } + /** The stage of the PublicIpAddress definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PublicIpAddress definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the public ip address.. + * + * @param extendedLocation The extended location of the public ip address. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PublicIpAddress definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The public IP address SKU.. + * + * @param sku The public IP address SKU. + * @return the next definition stage. + */ + WithCreate withSku(PublicIpAddressSku sku); + } + /** The stage of the PublicIpAddress definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpAllocationMethod. */ + interface WithPublicIpAllocationMethod { + /** + * Specifies the publicIpAllocationMethod property: The public IP address allocation method.. + * + * @param publicIpAllocationMethod The public IP address allocation method. + * @return the next definition stage. + */ + WithCreate withPublicIpAllocationMethod(IpAllocationMethod publicIpAllocationMethod); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpAddressVersion. */ + interface WithPublicIpAddressVersion { + /** + * Specifies the publicIpAddressVersion property: The public IP address version.. + * + * @param publicIpAddressVersion The public IP address version. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressVersion(IpVersion publicIpAddressVersion); + } + /** The stage of the PublicIpAddress definition allowing to specify dnsSettings. */ + interface WithDnsSettings { + /** + * Specifies the dnsSettings property: The FQDN of the DNS record associated with the public IP address.. + * + * @param dnsSettings The FQDN of the DNS record associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withDnsSettings(PublicIpAddressDnsSettings dnsSettings); + } + /** The stage of the PublicIpAddress definition allowing to specify ddosSettings. */ + interface WithDdosSettings { + /** + * Specifies the ddosSettings property: The DDoS protection custom policy associated with the public IP + * address.. + * + * @param ddosSettings The DDoS protection custom policy associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withDdosSettings(DdosSettings ddosSettings); + } + /** The stage of the PublicIpAddress definition allowing to specify ipTags. */ + interface WithIpTags { + /** + * Specifies the ipTags property: The list of tags associated with the public IP address.. + * + * @param ipTags The list of tags associated with the public IP address. + * @return the next definition stage. + */ + WithCreate withIpTags(List ipTags); + } + /** The stage of the PublicIpAddress definition allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The IP address associated with the public IP address resource.. + * + * @param ipAddress The IP address associated with the public IP address resource. + * @return the next definition stage. + */ + WithCreate withIpAddress(String ipAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify publicIpPrefix. */ + interface WithPublicIpPrefix { + /** + * Specifies the publicIpPrefix property: The Public IP Prefix this Public IP Address should be allocated + * from.. + * + * @param publicIpPrefix The Public IP Prefix this Public IP Address should be allocated from. + * @return the next definition stage. + */ + WithCreate withPublicIpPrefix(SubResource publicIpPrefix); + } + /** The stage of the PublicIpAddress definition allowing to specify idleTimeoutInMinutes. */ + interface WithIdleTimeoutInMinutes { + /** + * Specifies the idleTimeoutInMinutes property: The idle timeout of the public IP address.. + * + * @param idleTimeoutInMinutes The idle timeout of the public IP address. + * @return the next definition stage. + */ + WithCreate withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes); + } + /** The stage of the PublicIpAddress definition allowing to specify servicePublicIpAddress. */ + interface WithServicePublicIpAddress { + /** + * Specifies the servicePublicIpAddress property: The service public IP address of the public IP address + * resource.. + * + * @param servicePublicIpAddress The service public IP address of the public IP address resource. + * @return the next definition stage. + */ + WithCreate withServicePublicIpAddress(PublicIpAddressInner servicePublicIpAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: The NatGateway for the Public IP address.. + * + * @param natGateway The NatGateway for the Public IP address. + * @return the next definition stage. + */ + WithCreate withNatGateway(NatGatewayInner natGateway); + } + /** The stage of the PublicIpAddress definition allowing to specify migrationPhase. */ + interface WithMigrationPhase { + /** + * Specifies the migrationPhase property: Migration phase of Public IP Address.. + * + * @param migrationPhase Migration phase of Public IP Address. + * @return the next definition stage. + */ + WithCreate withMigrationPhase(PublicIpAddressMigrationPhase migrationPhase); + } + /** The stage of the PublicIpAddress definition allowing to specify linkedPublicIpAddress. */ + interface WithLinkedPublicIpAddress { + /** + * Specifies the linkedPublicIpAddress property: The linked public IP address of the public IP address + * resource.. + * + * @param linkedPublicIpAddress The linked public IP address of the public IP address resource. + * @return the next definition stage. + */ + WithCreate withLinkedPublicIpAddress(PublicIpAddressInner linkedPublicIpAddress); + } + /** The stage of the PublicIpAddress definition allowing to specify deleteOption. */ + interface WithDeleteOption { + /** + * Specifies the deleteOption property: Specify what happens to the public IP address when the VM using it + * is deleted. + * + * @param deleteOption Specify what happens to the public IP address when the VM using it is deleted. + * @return the next definition stage. + */ + WithCreate withDeleteOption(DeleteOptions deleteOption); + } + } + /** + * Begins update for the PublicIpAddress resource. + * + * @return the stage of resource update. + */ + PublicIpAddress.Update update(); + + /** The template for PublicIpAddress update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PublicIpAddress apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PublicIpAddress apply(Context context); + } + /** The PublicIpAddress update stages. */ + interface UpdateStages { + /** The stage of the PublicIpAddress update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PublicIpAddress refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PublicIpAddress refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java new file mode 100644 index 0000000000000..06ec86e489fca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains FQDN of the DNS record associated with the public IP address. */ +@Fluent +public final class PublicIpAddressDnsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressDnsSettings.class); + + /* + * The domain name label. The concatenation of the domain name label and + * the regionalized DNS zone make up the fully qualified domain name + * associated with the public IP address. If a domain name label is + * specified, an A DNS record is created for the public IP in the Microsoft + * Azure DNS system. + */ + @JsonProperty(value = "domainNameLabel") + private String domainNameLabel; + + /* + * The Fully Qualified Domain Name of the A DNS record associated with the + * public IP. This is the concatenation of the domainNameLabel and the + * regionalized DNS zone. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The reverse FQDN. A user-visible, fully qualified domain name that + * resolves to this public IP address. If the reverseFqdn is specified, + * then a PTR DNS record is created pointing from the IP address in the + * in-addr.arpa domain to the reverse FQDN. + */ + @JsonProperty(value = "reverseFqdn") + private String reverseFqdn; + + /** + * Get the domainNameLabel property: The domain name label. The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain + * name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The domain name label. The concatenation of the domain name label and the + * regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain + * name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get the fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is + * the concatenation of the domainNameLabel and the regionalized DNS zone. + * + * @param fqdn the fqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @return the reverseFqdn value. + */ + public String reverseFqdn() { + return this.reverseFqdn; + } + + /** + * Set the reverseFqdn property: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this + * public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address + * in the in-addr.arpa domain to the reverse FQDN. + * + * @param reverseFqdn the reverseFqdn value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings withReverseFqdn(String reverseFqdn) { + this.reverseFqdn = reverseFqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java new file mode 100644 index 0000000000000..a8445c231850e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpAddresses API service call. */ +@Fluent +public final class PublicIpAddressListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressListResult.class); + + /* + * A list of public IP addresses that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of public IP addresses that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of public IP addresses that exists in a resource group. + * + * @param value the value value to set. + * @return the PublicIpAddressListResult object itself. + */ + public PublicIpAddressListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PublicIpAddressListResult object itself. + */ + public PublicIpAddressListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java new file mode 100644 index 0000000000000..5acb713a217e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressMigrationPhase. */ +public final class PublicIpAddressMigrationPhase extends ExpandableStringEnum { + /** Static value None for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase NONE = fromString("None"); + + /** Static value Prepare for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase PREPARE = fromString("Prepare"); + + /** Static value Commit for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase COMMIT = fromString("Commit"); + + /** Static value Abort for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase ABORT = fromString("Abort"); + + /** Static value Committed for PublicIpAddressMigrationPhase. */ + public static final PublicIpAddressMigrationPhase COMMITTED = fromString("Committed"); + + /** + * Creates or finds a PublicIpAddressMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressMigrationPhase. + */ + @JsonCreator + public static PublicIpAddressMigrationPhase fromString(String name) { + return fromString(name, PublicIpAddressMigrationPhase.class); + } + + /** @return known PublicIpAddressMigrationPhase values. */ + public static Collection values() { + return values(PublicIpAddressMigrationPhase.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..5009c5a039f02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a public IP address. */ +@Fluent +public final class PublicIpAddressSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpAddressSku.class); + + /* + * Name of a public IP address SKU. + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Tier of a public IP address SKU. + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** + * Get the name property: Name of a public IP address SKU. + * + * @return the name value. + */ + public PublicIpAddressSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a public IP address SKU. + * + * @param name the name value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withName(PublicIpAddressSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a public IP address SKU. + * + * @return the tier value. + */ + public PublicIpAddressSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a public IP address SKU. + * + * @param tier the tier value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withTier(PublicIpAddressSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java new file mode 100644 index 0000000000000..38305e6bc357e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuName. */ +public final class PublicIpAddressSkuName extends ExpandableStringEnum { + /** Static value Basic for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName BASIC = fromString("Basic"); + + /** Static value Standard for PublicIpAddressSkuName. */ + public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + @JsonCreator + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** @return known PublicIpAddressSkuName values. */ + public static Collection values() { + return values(PublicIpAddressSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java new file mode 100644 index 0000000000000..e1a840a9147a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpAddressSkuTier. */ +public final class PublicIpAddressSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpAddressSkuTier. */ + public static final PublicIpAddressSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + @JsonCreator + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** @return known PublicIpAddressSkuTier values. */ + public static Collection values() { + return values(PublicIpAddressSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java new file mode 100644 index 0000000000000..0659690e8044a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PublicIpAddresses. */ +public interface PublicIpAddresses { + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + PagedIterable listCloudServicePublicIpAddresses(String resourceGroupName, String cloudServiceName); + + /** + * Gets information about all public IP addresses on a cloud service level. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a cloud service level. + */ + PagedIterable listCloudServicePublicIpAddresses( + String resourceGroupName, String cloudServiceName, Context context); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a role instance IP configuration in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The name of role instance. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a role instance IP configuration in a cloud service. + */ + PagedIterable listCloudServiceRoleInstancePublicIpAddresses( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service. + */ + PublicIpAddress getCloudServicePublicIpAddress( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a cloud service. + * + * @param resourceGroupName The name of the resource group. + * @param cloudServiceName The name of the cloud service. + * @param roleInstanceName The role instance name. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a cloud service along with {@link Response}. + */ + Response getCloudServicePublicIpAddressWithResponse( + String resourceGroupName, + String cloudServiceName, + String roleInstanceName, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String publicIpAddressName); + + /** + * Deletes the specified public IP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String publicIpAddressName, Context context); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group. + */ + PublicIpAddress getByResourceGroup(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the public IP address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpAddressName, String expand, Context context); + + /** + * Gets all the public IP addresses in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the public IP addresses in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP addresses in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP addresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP addresses in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName); + + /** + * Gets information about all public IP addresses on a virtual machine scale set level. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses on a virtual machine scale set level. + */ + PagedIterable listVirtualMachineScaleSetPublicIpAddresses( + String resourceGroupName, String virtualMachineScaleSetName, Context context); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName); + + /** + * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale + * set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The network interface name. + * @param ipConfigurationName The IP configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about all public IP addresses in a virtual machine IP configuration in a virtual machine + * scale set. + */ + PagedIterable listVirtualMachineScaleSetVMPublicIpAddresses( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + Context context); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set. + */ + PublicIpAddress getVirtualMachineScaleSetPublicIpAddress( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName); + + /** + * Get the specified public IP address in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param ipConfigurationName The name of the IP configuration. + * @param publicIpAddressName The name of the public IP Address. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a virtual machine scale set along with {@link Response}. + */ + Response getVirtualMachineScaleSetPublicIpAddressWithResponse( + String resourceGroupName, + String virtualMachineScaleSetName, + String virtualmachineIndex, + String networkInterfaceName, + String ipConfigurationName, + String publicIpAddressName, + String expand, + Context context); + + /** + * Gets the specified public IP address in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP address in a specified resource group 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/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..eeaee350c2afa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PublicIpPrefix. */ +public interface PublicIpPrefix { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extended location of the public ip address. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: The public IP prefix SKU. + * + * @return the sku value. + */ + PublicIpPrefixSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting the IP allocated for the resource needs to come + * from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner object. + * + * @return the inner object. + */ + PublicIpPrefixInner innerModel(); + + /** The entirety of the PublicIpPrefix definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PublicIpPrefix definition stages. */ + interface DefinitionStages { + /** The first stage of the PublicIpPrefix definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PublicIpPrefix definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PublicIpPrefix definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PublicIpPrefix definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithSku, + DefinitionStages.WithZones, + DefinitionStages.WithPublicIpAddressVersion, + DefinitionStages.WithIpTags, + DefinitionStages.WithPrefixLength, + DefinitionStages.WithCustomIpPrefix, + DefinitionStages.WithNatGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + PublicIpPrefix create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PublicIpPrefix create(Context context); + } + /** The stage of the PublicIpPrefix definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PublicIpPrefix definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the public ip address.. + * + * @param extendedLocation The extended location of the public ip address. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PublicIpPrefix definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The public IP prefix SKU.. + * + * @param sku The public IP prefix SKU. + * @return the next definition stage. + */ + WithCreate withSku(PublicIpPrefixSku sku); + } + /** The stage of the PublicIpPrefix definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting the IP allocated for the resource + * needs to come from.. + * + * @param zones A list of availability zones denoting the IP allocated for the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the PublicIpPrefix definition allowing to specify publicIpAddressVersion. */ + interface WithPublicIpAddressVersion { + /** + * Specifies the publicIpAddressVersion property: The public IP address version.. + * + * @param publicIpAddressVersion The public IP address version. + * @return the next definition stage. + */ + WithCreate withPublicIpAddressVersion(IpVersion publicIpAddressVersion); + } + /** The stage of the PublicIpPrefix definition allowing to specify ipTags. */ + interface WithIpTags { + /** + * Specifies the ipTags property: The list of tags associated with the public IP prefix.. + * + * @param ipTags The list of tags associated with the public IP prefix. + * @return the next definition stage. + */ + WithCreate withIpTags(List ipTags); + } + /** The stage of the PublicIpPrefix definition allowing to specify prefixLength. */ + interface WithPrefixLength { + /** + * Specifies the prefixLength property: The Length of the Public IP Prefix.. + * + * @param prefixLength The Length of the Public IP Prefix. + * @return the next definition stage. + */ + WithCreate withPrefixLength(Integer prefixLength); + } + /** The stage of the PublicIpPrefix definition allowing to specify customIpPrefix. */ + interface WithCustomIpPrefix { + /** + * Specifies the customIpPrefix property: The customIpPrefix that this prefix is associated with.. + * + * @param customIpPrefix The customIpPrefix that this prefix is associated with. + * @return the next definition stage. + */ + WithCreate withCustomIpPrefix(SubResource customIpPrefix); + } + /** The stage of the PublicIpPrefix definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: NatGateway of Public IP Prefix.. + * + * @param natGateway NatGateway of Public IP Prefix. + * @return the next definition stage. + */ + WithCreate withNatGateway(NatGatewayInner natGateway); + } + } + /** + * Begins update for the PublicIpPrefix resource. + * + * @return the stage of resource update. + */ + PublicIpPrefix.Update update(); + + /** The template for PublicIpPrefix update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PublicIpPrefix apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PublicIpPrefix apply(Context context); + } + /** The PublicIpPrefix update stages. */ + interface UpdateStages { + /** The stage of the PublicIpPrefix update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PublicIpPrefix refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PublicIpPrefix refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java new file mode 100644 index 0000000000000..b4e6bac96ae59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListPublicIpPrefixes API service call. */ +@Fluent +public final class PublicIpPrefixListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixListResult.class); + + /* + * A list of public IP prefixes that exists in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of public IP prefixes that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of public IP prefixes that exists in a resource group. + * + * @param value the value value to set. + * @return the PublicIpPrefixListResult object itself. + */ + public PublicIpPrefixListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the PublicIpPrefixListResult object itself. + */ + public PublicIpPrefixListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..fb2734dd6c015 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU of a public IP prefix. */ +@Fluent +public final class PublicIpPrefixSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PublicIpPrefixSku.class); + + /* + * Name of a public IP prefix SKU. + */ + @JsonProperty(value = "name") + private PublicIpPrefixSkuName name; + + /* + * Tier of a public IP prefix SKU. + */ + @JsonProperty(value = "tier") + private PublicIpPrefixSkuTier tier; + + /** + * Get the name property: Name of a public IP prefix SKU. + * + * @return the name value. + */ + public PublicIpPrefixSkuName name() { + return this.name; + } + + /** + * Set the name property: Name of a public IP prefix SKU. + * + * @param name the name value to set. + * @return the PublicIpPrefixSku object itself. + */ + public PublicIpPrefixSku withName(PublicIpPrefixSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of a public IP prefix SKU. + * + * @return the tier value. + */ + public PublicIpPrefixSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of a public IP prefix SKU. + * + * @param tier the tier value to set. + * @return the PublicIpPrefixSku object itself. + */ + public PublicIpPrefixSku withTier(PublicIpPrefixSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java new file mode 100644 index 0000000000000..274dd3ec0f0e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpPrefixSkuName. */ +public final class PublicIpPrefixSkuName extends ExpandableStringEnum { + /** Static value Standard for PublicIpPrefixSkuName. */ + public static final PublicIpPrefixSkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a PublicIpPrefixSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuName. + */ + @JsonCreator + public static PublicIpPrefixSkuName fromString(String name) { + return fromString(name, PublicIpPrefixSkuName.class); + } + + /** @return known PublicIpPrefixSkuName values. */ + public static Collection values() { + return values(PublicIpPrefixSkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java new file mode 100644 index 0000000000000..733b33d3c6286 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicIpPrefixSkuTier. */ +public final class PublicIpPrefixSkuTier extends ExpandableStringEnum { + /** Static value Regional for PublicIpPrefixSkuTier. */ + public static final PublicIpPrefixSkuTier REGIONAL = fromString("Regional"); + + /** Static value Global for PublicIpPrefixSkuTier. */ + public static final PublicIpPrefixSkuTier GLOBAL = fromString("Global"); + + /** + * Creates or finds a PublicIpPrefixSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuTier. + */ + @JsonCreator + public static PublicIpPrefixSkuTier fromString(String name) { + return fromString(name, PublicIpPrefixSkuTier.class); + } + + /** @return known PublicIpPrefixSkuTier values. */ + public static Collection values() { + return values(PublicIpPrefixSkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java new file mode 100644 index 0000000000000..35399164cbe53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PublicIpPrefixes. */ +public interface PublicIpPrefixes { + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Deletes the specified public IP prefix. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the PublicIpPrefix. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String publicIpPrefixName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group. + */ + PublicIpPrefix getByResourceGroup(String resourceGroupName, String publicIpPrefixName); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpPrefixName The name of the public IP prefix. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String publicIpPrefixName, String expand, Context context); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the public IP prefixes in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the public IP prefixes in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all public IP prefixes in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all public IP prefixes in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified public IP prefix in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified public IP prefix in a specified resource group 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..66a809c5ca9c2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosDefinition.class); + + /* + * 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; + + /** + * 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..6e51697cfd3bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Qos Traffic Profiler IP Range properties. */ +@Fluent +public final class QosIpRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosIpRange.class); + + /* + * Start IP Address. + */ + @JsonProperty(value = "startIP") + private String startIp; + + /* + * End IP Address. + */ + @JsonProperty(value = "endIP") + private String endIp; + + /** + * Get the startIp property: Start IP Address. + * + * @return the startIp value. + */ + public String startIp() { + return this.startIp; + } + + /** + * Set the startIp property: Start IP Address. + * + * @param startIp the startIp value to set. + * @return the QosIpRange object itself. + */ + public QosIpRange withStartIp(String startIp) { + this.startIp = startIp; + return this; + } + + /** + * Get the endIp property: End IP Address. + * + * @return the endIp value. + */ + public String endIp() { + return this.endIp; + } + + /** + * Set the endIp property: End IP Address. + * + * @param endIp the endIp value to set. + * @return the QosIpRange object itself. + */ + public QosIpRange withEndIp(String endIp) { + this.endIp = endIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java new file mode 100644 index 0000000000000..f0cc81a5a7e5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Qos Traffic Profiler Port range properties. */ +@Fluent +public final class QosPortRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QosPortRange.class); + + /* + * Qos Port Range start. + */ + @JsonProperty(value = "start") + private Integer start; + + /* + * Qos Port Range end. + */ + @JsonProperty(value = "end") + private Integer end; + + /** + * Get the start property: Qos Port Range start. + * + * @return the start value. + */ + public Integer start() { + return this.start; + } + + /** + * Set the start property: Qos Port Range start. + * + * @param start the start value to set. + * @return the QosPortRange object itself. + */ + public QosPortRange withStart(Integer start) { + this.start = start; + return this; + } + + /** + * Get the end property: Qos Port Range end. + * + * @return the end value. + */ + public Integer end() { + return this.end; + } + + /** + * Set the end property: Qos Port Range end. + * + * @param end the end value to set. + * @return the QosPortRange object itself. + */ + public QosPortRange withEnd(Integer end) { + this.end = end; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..35a2312ddfac4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or IpAddress should be set. */ +@Fluent +public final class QueryInboundNatRulePortMappingRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryInboundNatRulePortMappingRequest.class); + + /* + * 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; + + /** + * 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/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..b7f929491f597 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the resource to query the troubleshooting result. */ +@Fluent +public final class QueryTroubleshootingParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryTroubleshootingParameters.class); + + /* + * The target resource ID to query the troubleshooting result. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: The target resource ID to query the troubleshooting result. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The target resource ID to query the troubleshooting result. + * + * @param targetResourceId the targetResourceId value to set. + * @return the QueryTroubleshootingParameters object itself. + */ + public QueryTroubleshootingParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model QueryTroubleshootingParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java new file mode 100644 index 0000000000000..23a5ba9b89bd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Radius Server Settings. */ +@Fluent +public final class RadiusServer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RadiusServer.class); + + /* + * The address of this radius server. + */ + @JsonProperty(value = "radiusServerAddress", required = true) + private String radiusServerAddress; + + /* + * The initial score assigned to this radius server. + */ + @JsonProperty(value = "radiusServerScore") + private Long radiusServerScore; + + /* + * The secret used for this radius server. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /** + * Get the radiusServerAddress property: The address of this radius server. + * + * @return the radiusServerAddress value. + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radiusServerAddress property: The address of this radius server. + * + * @param radiusServerAddress the radiusServerAddress value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radiusServerScore property: The initial score assigned to this radius server. + * + * @return the radiusServerScore value. + */ + public Long radiusServerScore() { + return this.radiusServerScore; + } + + /** + * Set the radiusServerScore property: The initial score assigned to this radius server. + * + * @param radiusServerScore the radiusServerScore value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerScore(Long radiusServerScore) { + this.radiusServerScore = radiusServerScore; + return this; + } + + /** + * Get the radiusServerSecret property: The secret used for this radius server. + * + * @return the radiusServerSecret value. + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radiusServerSecret property: The secret used for this radius server. + * + * @param radiusServerSecret the radiusServerSecret value to set. + * @return the RadiusServer object itself. + */ + public RadiusServer withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (radiusServerAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property radiusServerAddress in model RadiusServer")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java new file mode 100644 index 0000000000000..cb7be0511182f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A collective group of information about the record set information. */ +@Fluent +public final class RecordSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecordSet.class); + + /* + * Resource record type. + */ + @JsonProperty(value = "recordType") + private String recordType; + + /* + * Recordset name. + */ + @JsonProperty(value = "recordSetName") + private String recordSetName; + + /* + * Fqdn that resolves to private endpoint ip address. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The provisioning state of the recordset. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Recordset time to live. + */ + @JsonProperty(value = "ttl") + private Integer ttl; + + /* + * The private ip address of the private endpoint. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** + * Get the recordType property: Resource record type. + * + * @return the recordType value. + */ + public String recordType() { + return this.recordType; + } + + /** + * Set the recordType property: Resource record type. + * + * @param recordType the recordType value to set. + * @return the RecordSet object itself. + */ + public RecordSet withRecordType(String recordType) { + this.recordType = recordType; + return this; + } + + /** + * Get the recordSetName property: Recordset name. + * + * @return the recordSetName value. + */ + public String recordSetName() { + return this.recordSetName; + } + + /** + * Set the recordSetName property: Recordset name. + * + * @param recordSetName the recordSetName value to set. + * @return the RecordSet object itself. + */ + public RecordSet withRecordSetName(String recordSetName) { + this.recordSetName = recordSetName; + return this; + } + + /** + * Get the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fqdn that resolves to private endpoint ip address. + * + * @param fqdn the fqdn value to set. + * @return the RecordSet object itself. + */ + public RecordSet withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the recordset. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ttl property: Recordset time to live. + * + * @return the ttl value. + */ + public Integer ttl() { + return this.ttl; + } + + /** + * Set the ttl property: Recordset time to live. + * + * @param ttl the ttl value to set. + * @return the RecordSet object itself. + */ + public RecordSet withTtl(Integer ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the ipAddresses property: The private ip address of the private endpoint. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: The private ip address of the private endpoint. + * + * @param ipAddresses the ipAddresses value to set. + * @return the RecordSet object itself. + */ + public RecordSet withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java new file mode 100644 index 0000000000000..6a1d039d6c308 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reference to a public IP address. */ +@Fluent +public final class ReferencedPublicIpAddress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReferencedPublicIpAddress.class); + + /* + * The PublicIPAddress Reference. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The PublicIPAddress Reference. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The PublicIPAddress Reference. + * + * @param id the id value to set. + * @return the ReferencedPublicIpAddress object itself. + */ + public ReferencedPublicIpAddress withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..2776c96213453 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.java new file mode 100644 index 0000000000000..ed59e400f7853 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinkFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ResourceNavigationLink resource. */ +@Fluent +public final class ResourceNavigationLink extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNavigationLink.class); + + /* + * 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; + + /** + * 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..0421e6f534071 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceNavigationLinks. */ +public interface ResourceNavigationLinks { + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet. + */ + ResourceNavigationLinksListResult list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of resource navigation links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of resource navigation links for a subnet along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java new file mode 100644 index 0000000000000..8ba08d898b2f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ResourceNavigationLinksListResult. */ +public interface ResourceNavigationLinksListResult { + /** + * Gets the value property: The resource navigation links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinksListResultInner + * object. + * + * @return the inner object. + */ + ResourceNavigationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java new file mode 100644 index 0000000000000..c65d654ef7a06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Creates a Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable putBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Deletes the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest); + + /** + * Return the Bastion Shareable Links for all the VMs specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslRequest Post request for all the Bastion Shareable Link endpoints. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints. + */ + PagedIterable getBastionShareableLink( + String resourceGroupName, String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions. + */ + PagedIterable getActiveSessions( + String resourceGroupName, String bastionHostname, Context context); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds); + + /** + * Returns the list of currently active sessions on the Bastion. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param sessionIds The list of sessionids to disconnect. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions. + */ + PagedIterable disconnectActiveSessions( + String resourceGroupName, String bastionHostname, SessionIds sessionIds, Context context); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call. + */ + DnsNameAvailabilityResult checkDnsNameAvailability(String location, String domainNameLabel); + + /** + * Checks whether a domain name in the cloudapp.azure.com zone is available for use. + * + * @param location The location of the domain name. + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: + * ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the CheckDnsNameAvailability API service call along with {@link Response}. + */ + Response checkDnsNameAvailabilityWithResponse( + String location, String domainNameLabel, Context context); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders. + */ + VirtualWanSecurityProviders supportedSecurityProviders(String resourceGroupName, String virtualWanName); + + /** + * Gives the supported security providers for the virtual wan. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN for which supported security providers are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of SecurityProviders along with {@link Response}. + */ + Response supportedSecurityProvidersWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, String virtualWanName, VirtualWanVpnProfileParameters vpnClientParams); + + /** + * Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination + * in the specified resource group. + * + * @param resourceGroupName The resource group name. + * @param virtualWanName The name of the VirtualWAN whose associated VpnServerConfigurations is needed. + * @param vpnClientParams Parameters supplied to the generate VirtualWan VPN profile generation operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpn Profile Response for package generation. + */ + VpnProfileResponse generatevirtualwanvpnserverconfigurationvpnprofile( + String resourceGroupName, + String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java new file mode 100644 index 0000000000000..18a397ee0ad23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The base resource set for visibility and auto-approval. */ +@Fluent +public class ResourceSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSet.class); + + /* + * The list of subscriptions. + */ + @JsonProperty(value = "subscriptions") + private List subscriptions; + + /** + * Get the subscriptions property: The list of subscriptions. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: The list of subscriptions. + * + * @param subscriptions the subscriptions value to set. + * @return the ResourceSet object itself. + */ + public ResourceSet withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java new file mode 100644 index 0000000000000..71d0a480667d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the retention policy for flow log. */ +@Fluent +public final class RetentionPolicyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RetentionPolicyParameters.class); + + /* + * Number of days to retain flow log records. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * Flag to enable/disable retention. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the days property: Number of days to retain flow log records. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: Number of days to retain flow log records. + * + * @param days the days value to set. + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the enabled property: Flag to enable/disable retention. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable retention. + * + * @param enabled the enabled value to set. + * @return the RetentionPolicyParameters object itself. + */ + public RetentionPolicyParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java new file mode 100644 index 0000000000000..01642031b1856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; + +/** An immutable client-side representation of Route. */ +public interface Route { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the nextHopType property: The type of Azure hop the packet should be sent to. + * + * @return the nextHopType value. + */ + RouteNextHopType nextHopType(); + + /** + * Gets the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values are only + * allowed in routes where the next hop type is VirtualAppliance. + * + * @return the nextHopIpAddress value. + */ + String nextHopIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the route resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP routes + * regardless of LPM. + * + * @return the hasBgpOverride value. + */ + Boolean hasBgpOverride(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteInner object. + * + * @return the inner object. + */ + RouteInner innerModel(); + + /** The entirety of the Route definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Route definition stages. */ + interface DefinitionStages { + /** The first stage of the Route definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Route definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, routeTableName. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the next definition stage. + */ + WithCreate withExistingRouteTable(String resourceGroupName, String routeTableName); + } + /** + * The stage of the Route definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithNextHopType, + DefinitionStages.WithNextHopIpAddress, + DefinitionStages.WithHasBgpOverride { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route create(Context context); + } + /** The stage of the Route definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Route definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Route definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Route definition allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + WithCreate withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route definition allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + WithCreate withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route definition allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + WithCreate withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Begins update for the Route resource. + * + * @return the stage of resource update. + */ + Route.Update update(); + + /** The template for Route update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithNextHopType, + UpdateStages.WithNextHopIpAddress, + UpdateStages.WithHasBgpOverride { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route apply(Context context); + } + /** The Route update stages. */ + interface UpdateStages { + /** The stage of the Route update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Route update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Route update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The destination CIDR to which the route applies.. + * + * @param addressPrefix The destination CIDR to which the route applies. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Route update allowing to specify nextHopType. */ + interface WithNextHopType { + /** + * Specifies the nextHopType property: The type of Azure hop the packet should be sent to.. + * + * @param nextHopType The type of Azure hop the packet should be sent to. + * @return the next definition stage. + */ + Update withNextHopType(RouteNextHopType nextHopType); + } + /** The stage of the Route update allowing to specify nextHopIpAddress. */ + interface WithNextHopIpAddress { + /** + * Specifies the nextHopIpAddress property: The IP address packets should be forwarded to. Next hop values + * are only allowed in routes where the next hop type is VirtualAppliance.. + * + * @param nextHopIpAddress The IP address packets should be forwarded to. Next hop values are only allowed + * in routes where the next hop type is VirtualAppliance. + * @return the next definition stage. + */ + Update withNextHopIpAddress(String nextHopIpAddress); + } + /** The stage of the Route update allowing to specify hasBgpOverride. */ + interface WithHasBgpOverride { + /** + * Specifies the hasBgpOverride property: A value indicating whether this route overrides overlapping BGP + * routes regardless of LPM.. + * + * @param hasBgpOverride A value indicating whether this route overrides overlapping BGP routes regardless + * of LPM. + * @return the next definition stage. + */ + Update withHasBgpOverride(Boolean hasBgpOverride); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java new file mode 100644 index 0000000000000..46a9d9ea59250 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RouteFilter. */ +public interface RouteFilter { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner object. + * + * @return the inner object. + */ + RouteFilterInner innerModel(); + + /** The entirety of the RouteFilter definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RouteFilter definition stages. */ + interface DefinitionStages { + /** The first stage of the RouteFilter definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RouteFilter definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the RouteFilter definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RouteFilter definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + RouteFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RouteFilter create(Context context); + } + /** The stage of the RouteFilter definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the RouteFilter definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: Collection of RouteFilterRules contained within a route filter.. + * + * @param rules Collection of RouteFilterRules contained within a route filter. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the RouteFilter resource. + * + * @return the stage of resource update. + */ + RouteFilter.Update update(); + + /** The template for RouteFilter update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RouteFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RouteFilter apply(Context context); + } + /** The RouteFilter update stages. */ + interface UpdateStages { + /** The stage of the RouteFilter update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RouteFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RouteFilter refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java new file mode 100644 index 0000000000000..14f3d575e52dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilters API service call. */ +@Fluent +public final class RouteFilterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterListResult.class); + + /* + * A list of route filters in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of route filters in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of route filters in a resource group. + * + * @param value the value value to set. + * @return the RouteFilterListResult object itself. + */ + public RouteFilterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteFilterListResult object itself. + */ + public RouteFilterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java new file mode 100644 index 0000000000000..00b9e209e89c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.util.List; + +/** An immutable client-side representation of RouteFilterRule. */ +public interface RouteFilterRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the access property: The access type of the rule. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the routeFilterRuleType property: The rule type of the rule. + * + * @return the routeFilterRuleType value. + */ + RouteFilterRuleType routeFilterRuleType(); + + /** + * Gets the communities property: The collection for bgp community values to filter on. e.g. + * ['12076:5010','12076:5020']. + * + * @return the communities value. + */ + List communities(); + + /** + * Gets the provisioningState property: The provisioning state of the route filter rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner object. + * + * @return the inner object. + */ + RouteFilterRuleInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java new file mode 100644 index 0000000000000..562aa13d4e6c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteFilterRules API service call. */ +@Fluent +public final class RouteFilterRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteFilterRuleListResult.class); + + /* + * A list of RouteFilterRules in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of RouteFilterRules in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of RouteFilterRules in a resource group. + * + * @param value the value value to set. + * @return the RouteFilterRuleListResult object itself. + */ + public RouteFilterRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteFilterRuleListResult object itself. + */ + public RouteFilterRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java new file mode 100644 index 0000000000000..fd0f32c47cb33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RouteFilterRuleType. */ +public final class RouteFilterRuleType extends ExpandableStringEnum { + /** Static value Community for RouteFilterRuleType. */ + public static final RouteFilterRuleType COMMUNITY = fromString("Community"); + + /** + * Creates or finds a RouteFilterRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteFilterRuleType. + */ + @JsonCreator + public static RouteFilterRuleType fromString(String name) { + return fromString(name, RouteFilterRuleType.class); + } + + /** @return known RouteFilterRuleType values. */ + public static Collection values() { + return values(RouteFilterRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java new file mode 100644 index 0000000000000..25c57a5f6e920 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; + +/** Resource collection API of RouteFilterRules. */ +public interface RouteFilterRules { + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Deletes the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter. + */ + RouteFilterRule get(String resourceGroupName, String routeFilterName, String ruleName); + + /** + * Gets the specified rule from a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified rule from a route filter along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String routeFilterName, String ruleName, Context context); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters); + + /** + * Creates or updates a route in the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param ruleName The name of the route filter rule. + * @param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return route Filter Rule Resource. + */ + RouteFilterRule createOrUpdate( + String resourceGroupName, + String routeFilterName, + String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, + Context context); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName); + + /** + * Gets all RouteFilterRules in a route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all RouteFilterRules in a route filter. + */ + PagedIterable listByRouteFilter(String resourceGroupName, String routeFilterName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java new file mode 100644 index 0000000000000..80c2c28f3152e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RouteFilters. */ +public interface RouteFilters { + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Deletes the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeFilterName, Context context); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter. + */ + RouteFilter getByResourceGroup(String resourceGroupName, String routeFilterName); + + /** + * Gets the specified route filter. + * + * @param resourceGroupName The name of the resource group. + * @param routeFilterName The name of the route filter. + * @param expand Expands referenced express route bgp peering resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeFilterName, String expand, Context context); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route filters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route filters in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + PagedIterable list(); + + /** + * Gets all route filters in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route filters in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified route filter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route filter 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..40ccc3f827008 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRoute API service call. */ +@Fluent +public final class RouteListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteListResult.class); + + /* + * A list of routes in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of routes in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of routes in a resource group. + * + * @param value the value value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteListResult object itself. + */ + public RouteListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java new file mode 100644 index 0000000000000..b337e88d62d9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RouteNextHopType. */ +public final class RouteNextHopType extends ExpandableStringEnum { + /** Static value VirtualNetworkGateway for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** Static value VnetLocal for RouteNextHopType. */ + public static final RouteNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** Static value Internet for RouteNextHopType. */ + public static final RouteNextHopType INTERNET = fromString("Internet"); + + /** Static value VirtualAppliance for RouteNextHopType. */ + public static final RouteNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** Static value None for RouteNextHopType. */ + public static final RouteNextHopType NONE = fromString("None"); + + /** + * Creates or finds a RouteNextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteNextHopType. + */ + @JsonCreator + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** @return known RouteNextHopType values. */ + public static Collection values() { + return values(RouteNextHopType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java new file mode 100644 index 0000000000000..9e24b76efe71f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of RouteTable. */ +public interface RouteTable { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner object. + * + * @return the inner object. + */ + RouteTableInner innerModel(); + + /** The entirety of the RouteTable definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The RouteTable definition stages. */ + interface DefinitionStages { + /** The first stage of the RouteTable definition. */ + interface Blank extends WithLocation { + } + /** The stage of the RouteTable definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the RouteTable definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the RouteTable definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithRoutes, + DefinitionStages.WithDisableBgpRoutePropagation { + /** + * Executes the create request. + * + * @return the created resource. + */ + RouteTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RouteTable create(Context context); + } + /** The stage of the RouteTable definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the RouteTable definition allowing to specify routes. */ + interface WithRoutes { + /** + * Specifies the routes property: Collection of routes contained within a route table.. + * + * @param routes Collection of routes contained within a route table. + * @return the next definition stage. + */ + WithCreate withRoutes(List routes); + } + /** The stage of the RouteTable definition allowing to specify disableBgpRoutePropagation. */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies the disableBgpRoutePropagation property: Whether to disable the routes learned by BGP on that + * route table. True means disable.. + * + * @param disableBgpRoutePropagation Whether to disable the routes learned by BGP on that route table. True + * means disable. + * @return the next definition stage. + */ + WithCreate withDisableBgpRoutePropagation(Boolean disableBgpRoutePropagation); + } + } + /** + * Begins update for the RouteTable resource. + * + * @return the stage of resource update. + */ + RouteTable.Update update(); + + /** The template for RouteTable update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RouteTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RouteTable apply(Context context); + } + /** The RouteTable update stages. */ + interface UpdateStages { + /** The stage of the RouteTable update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RouteTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RouteTable refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java new file mode 100644 index 0000000000000..92787f1e08d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListRouteTable API service call. */ +@Fluent +public final class RouteTableListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RouteTableListResult.class); + + /* + * A list of route tables in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of route tables in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of route tables in a resource group. + * + * @param value the value value to set. + * @return the RouteTableListResult object itself. + */ + public RouteTableListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RouteTableListResult object itself. + */ + public RouteTableListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java new file mode 100644 index 0000000000000..43bc8604162df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RouteTables. */ +public interface RouteTables { + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Deletes the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, Context context); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table. + */ + RouteTable getByResourceGroup(String resourceGroupName, String routeTableName); + + /** + * Gets the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String routeTableName, String expand, Context context); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all route tables in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + PagedIterable list(); + + /** + * Gets all route tables in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all route tables in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified route table. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route table 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..f81dfb8e01e52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Routes. */ +public interface Routes { + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, String routeName); + + /** + * Deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table. + */ + Route get(String resourceGroupName, String routeTableName, String routeName); + + /** + * Gets the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String routeTableName, String routeName, Context context); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + PagedIterable list(String resourceGroupName, String routeTableName); + + /** + * Gets all routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all routes in a route table. + */ + PagedIterable list(String resourceGroupName, String routeTableName, Context context); + + /** + * Gets the specified route from a route table. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified route from a route table 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..8806d521cf6a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Routing Configuration indicating the associated and propagated route tables for this connection. */ +@Fluent +public final class RoutingConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingConfiguration.class); + + /* + * The resource id RouteTable associated with this RoutingConfiguration. + */ + @JsonProperty(value = "associatedRouteTable") + private SubResource associatedRouteTable; + + /* + * The list of RouteTables to advertise the routes to. + */ + @JsonProperty(value = "propagatedRouteTables") + private PropagatedRouteTable propagatedRouteTables; + + /* + * List of routes that control routing from VirtualHub into a virtual + * network connection. + */ + @JsonProperty(value = "vnetRoutes") + private VnetRoute vnetRoutes; + + /** + * Get the associatedRouteTable property: The resource id RouteTable associated with this RoutingConfiguration. + * + * @return the associatedRouteTable value. + */ + public SubResource associatedRouteTable() { + return this.associatedRouteTable; + } + + /** + * Set the associatedRouteTable property: The resource id RouteTable associated with this RoutingConfiguration. + * + * @param associatedRouteTable the associatedRouteTable value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withAssociatedRouteTable(SubResource associatedRouteTable) { + this.associatedRouteTable = associatedRouteTable; + return this; + } + + /** + * Get the propagatedRouteTables property: The list of RouteTables to advertise the routes to. + * + * @return the propagatedRouteTables value. + */ + public PropagatedRouteTable propagatedRouteTables() { + return this.propagatedRouteTables; + } + + /** + * Set the propagatedRouteTables property: The list of RouteTables to advertise the routes to. + * + * @param propagatedRouteTables the propagatedRouteTables value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withPropagatedRouteTables(PropagatedRouteTable propagatedRouteTables) { + this.propagatedRouteTables = propagatedRouteTables; + return this; + } + + /** + * Get the vnetRoutes property: List of routes that control routing from VirtualHub into a virtual network + * connection. + * + * @return the vnetRoutes value. + */ + public VnetRoute vnetRoutes() { + return this.vnetRoutes; + } + + /** + * Set the vnetRoutes property: List of routes that control routing from VirtualHub into a virtual network + * connection. + * + * @param vnetRoutes the vnetRoutes value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withVnetRoutes(VnetRoute vnetRoutes) { + this.vnetRoutes = vnetRoutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (propagatedRouteTables() != null) { + propagatedRouteTables().validate(); + } + if (vnetRoutes() != null) { + vnetRoutes().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..83faac84dd28e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntent.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.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 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..1f0a7e0ef8305 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..cb559a09a0f54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The routing policy object used in a RoutingIntent resource. */ +@Fluent +public final class RoutingPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingPolicy.class); + + /* + * 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; + + /** + * 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")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java new file mode 100644 index 0000000000000..a9cb1ac92cde0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingState. */ +public final class RoutingState extends ExpandableStringEnum { + /** Static value None for RoutingState. */ + public static final RoutingState NONE = fromString("None"); + + /** Static value Provisioned for RoutingState. */ + public static final RoutingState PROVISIONED = fromString("Provisioned"); + + /** Static value Provisioning for RoutingState. */ + public static final RoutingState PROVISIONING = fromString("Provisioning"); + + /** Static value Failed for RoutingState. */ + public static final RoutingState FAILED = fromString("Failed"); + + /** + * Creates or finds a RoutingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingState. + */ + @JsonCreator + public static RoutingState fromString(String name) { + return fromString(name, RoutingState.class); + } + + /** @return known RoutingState values. */ + public static Collection values() { + return values(RoutingState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java new file mode 100644 index 0000000000000..fe9c7e42188f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network interface and all its associated security rules. */ +@Fluent +public final class SecurityGroupNetworkInterface { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupNetworkInterface.class); + + /* + * ID of the network interface. + */ + @JsonProperty(value = "id") + private String id; + + /* + * All security rules associated with the network interface. + */ + @JsonProperty(value = "securityRuleAssociations") + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Get the id property: ID of the network interface. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the network interface. + * + * @param id the id value to set. + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withId(String id) { + this.id = id; + return this; + } + + /** + * Get the securityRuleAssociations property: All security rules associated with the network interface. + * + * @return the securityRuleAssociations value. + */ + public SecurityRuleAssociations securityRuleAssociations() { + return this.securityRuleAssociations; + } + + /** + * Set the securityRuleAssociations property: All security rules associated with the network interface. + * + * @param securityRuleAssociations the securityRuleAssociations value to set. + * @return the SecurityGroupNetworkInterface object itself. + */ + public SecurityGroupNetworkInterface withSecurityRuleAssociations( + SecurityRuleAssociations securityRuleAssociations) { + this.securityRuleAssociations = securityRuleAssociations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRuleAssociations() != null) { + securityRuleAssociations().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java new file mode 100644 index 0000000000000..63fb7885cd0eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the VM to check security groups for. */ +@Fluent +public final class SecurityGroupViewParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityGroupViewParameters.class); + + /* + * ID of the target VM. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /** + * Get the targetResourceId property: ID of the target VM. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: ID of the target VM. + * + * @param targetResourceId the targetResourceId value to set. + * @return the SecurityGroupViewParameters object itself. + */ + public SecurityGroupViewParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model SecurityGroupViewParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java new file mode 100644 index 0000000000000..363f7178b5daa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner; +import java.util.List; + +/** An immutable client-side representation of SecurityGroupViewResult. */ +public interface SecurityGroupViewResult { + /** + * Gets the networkInterfaces property: List of network interfaces on the specified VM. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityGroupViewResultInner object. + * + * @return the inner object. + */ + SecurityGroupViewResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java new file mode 100644 index 0000000000000..ad427a2e953dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import java.util.Map; + +/** An immutable client-side representation of SecurityPartnerProvider. */ +public interface SecurityPartnerProvider { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner object. + * + * @return the inner object. + */ + SecurityPartnerProviderInner innerModel(); + + /** The entirety of the SecurityPartnerProvider definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SecurityPartnerProvider definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityPartnerProvider definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SecurityPartnerProvider definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SecurityPartnerProvider definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SecurityPartnerProvider definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSecurityProviderName, + DefinitionStages.WithVirtualHub { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityPartnerProvider create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityPartnerProvider create(Context context); + } + /** The stage of the SecurityPartnerProvider definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SecurityPartnerProvider definition allowing to specify securityProviderName. */ + interface WithSecurityProviderName { + /** + * Specifies the securityProviderName property: The security provider name.. + * + * @param securityProviderName The security provider name. + * @return the next definition stage. + */ + WithCreate withSecurityProviderName(SecurityProviderName securityProviderName); + } + /** The stage of the SecurityPartnerProvider definition allowing to specify virtualHub. */ + interface WithVirtualHub { + /** + * Specifies the virtualHub property: The virtualHub to which the Security Partner Provider belongs.. + * + * @param virtualHub The virtualHub to which the Security Partner Provider belongs. + * @return the next definition stage. + */ + WithCreate withVirtualHub(SubResource virtualHub); + } + } + /** + * Begins update for the SecurityPartnerProvider resource. + * + * @return the stage of resource update. + */ + SecurityPartnerProvider.Update update(); + + /** The template for SecurityPartnerProvider update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityPartnerProvider apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityPartnerProvider apply(Context context); + } + /** The SecurityPartnerProvider update stages. */ + interface UpdateStages { + /** The stage of the SecurityPartnerProvider update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityPartnerProvider refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityPartnerProvider refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java new file mode 100644 index 0000000000000..7d1e741915dd3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityPartnerProviderConnectionStatus. */ +public final class SecurityPartnerProviderConnectionStatus + extends ExpandableStringEnum { + /** Static value Unknown for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value PartiallyConnected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus PARTIALLY_CONNECTED = fromString("PartiallyConnected"); + + /** Static value Connected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for SecurityPartnerProviderConnectionStatus. */ + public static final SecurityPartnerProviderConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a SecurityPartnerProviderConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityPartnerProviderConnectionStatus. + */ + @JsonCreator + public static SecurityPartnerProviderConnectionStatus fromString(String name) { + return fromString(name, SecurityPartnerProviderConnectionStatus.class); + } + + /** @return known SecurityPartnerProviderConnectionStatus values. */ + public static Collection values() { + return values(SecurityPartnerProviderConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java new file mode 100644 index 0000000000000..ffff66b8664ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSecurityPartnerProviders API service call. */ +@Fluent +public final class SecurityPartnerProviderListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityPartnerProviderListResult.class); + + /* + * List of Security Partner Providers in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Security Partner Providers in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Security Partner Providers in a resource group. + * + * @param value the value value to set. + * @return the SecurityPartnerProviderListResult object itself. + */ + public SecurityPartnerProviderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityPartnerProviderListResult object itself. + */ + public SecurityPartnerProviderListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java new file mode 100644 index 0000000000000..1ec3b7eb54bb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SecurityPartnerProviders. */ +public interface SecurityPartnerProviders { + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String securityPartnerProviderName); + + /** + * Deletes the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider. + */ + SecurityPartnerProvider getByResourceGroup(String resourceGroupName, String securityPartnerProviderName); + + /** + * Gets the specified Security Partner Provider. + * + * @param resourceGroupName The name of the resource group. + * @param securityPartnerProviderName The name of the Security Partner Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String securityPartnerProviderName, Context context); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Security Partner Providers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Security Partner Providers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Security Partner Providers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Security Partner Provider. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Security Partner Provider 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..8443a51d3a6e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityProviderName. */ +public final class SecurityProviderName extends ExpandableStringEnum { + /** Static value ZScaler for SecurityProviderName. */ + public static final SecurityProviderName ZSCALER = fromString("ZScaler"); + + /** Static value IBoss for SecurityProviderName. */ + public static final SecurityProviderName IBOSS = fromString("IBoss"); + + /** Static value Checkpoint for SecurityProviderName. */ + public static final SecurityProviderName CHECKPOINT = fromString("Checkpoint"); + + /** + * Creates or finds a SecurityProviderName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityProviderName. + */ + @JsonCreator + public static SecurityProviderName fromString(String name) { + return fromString(name, SecurityProviderName.class); + } + + /** @return known SecurityProviderName values. */ + public static Collection values() { + return values(SecurityProviderName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java new file mode 100644 index 0000000000000..5d1bc7d166ef0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java @@ -0,0 +1,677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.util.List; + +/** An immutable client-side representation of SecurityRule. */ +public interface SecurityRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + String description(); + + /** + * Gets the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + SecurityRuleProtocol protocol(); + + /** + * Gets the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' + * can also be used to match all ports. + * + * @return the sourcePortRange value. + */ + String sourcePortRange(); + + /** + * Gets the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports. + * + * @return the destinationPortRange value. + */ + String destinationPortRange(); + + /** + * Gets the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to match all + * source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this + * is an ingress rule, specifies where network traffic originates from. + * + * @return the sourceAddressPrefix value. + */ + String sourceAddressPrefix(); + + /** + * Gets the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value. + */ + List sourceAddressPrefixes(); + + /** + * Gets the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value. + */ + List sourceApplicationSecurityGroups(); + + /** + * Gets the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. + * Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' + * and 'Internet' can also be used. + * + * @return the destinationAddressPrefix value. + */ + String destinationAddressPrefix(); + + /** + * Gets the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinationAddressPrefixes value. + */ + List destinationAddressPrefixes(); + + /** + * Gets the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value. + */ + List destinationApplicationSecurityGroups(); + + /** + * Gets the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + List sourcePortRanges(); + + /** + * Gets the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + List destinationPortRanges(); + + /** + * Gets the access property: The network traffic is allowed or denied. + * + * @return the access value. + */ + SecurityRuleAccess access(); + + /** + * Gets the priority property: The priority of the rule. The value can be between 100 and 4096. The priority number + * must be unique for each rule in the collection. The lower the priority number, the higher the priority of the + * rule. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the direction property: The direction of the rule. The direction specifies if rule will be evaluated on + * incoming or outgoing traffic. + * + * @return the direction value. + */ + SecurityRuleDirection direction(); + + /** + * Gets the provisioningState property: The provisioning state of the security rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner object. + * + * @return the inner object. + */ + SecurityRuleInner innerModel(); + + /** The entirety of the SecurityRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SecurityRule definition stages. */ + interface DefinitionStages { + /** The first stage of the SecurityRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SecurityRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkSecurityGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the next definition stage. + */ + WithCreate withExistingNetworkSecurityGroup(String resourceGroupName, String networkSecurityGroupName); + } + /** + * The stage of the SecurityRule definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithType, + DefinitionStages.WithDescription, + DefinitionStages.WithProtocol, + DefinitionStages.WithSourcePortRange, + DefinitionStages.WithDestinationPortRange, + DefinitionStages.WithSourceAddressPrefix, + DefinitionStages.WithSourceAddressPrefixes, + DefinitionStages.WithSourceApplicationSecurityGroups, + DefinitionStages.WithDestinationAddressPrefix, + DefinitionStages.WithDestinationAddressPrefixes, + DefinitionStages.WithDestinationApplicationSecurityGroups, + DefinitionStages.WithSourcePortRanges, + DefinitionStages.WithDestinationPortRanges, + DefinitionStages.WithAccess, + DefinitionStages.WithPriority, + DefinitionStages.WithDirection { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityRule create(Context context); + } + /** The stage of the SecurityRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the SecurityRule definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the SecurityRule definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule. Restricted to 140 chars.. + * + * @param description A description for this rule. Restricted to 140 chars. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the SecurityRule definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Network protocol this rule applies to.. + * + * @param protocol Network protocol this rule applies to. + * @return the next definition stage. + */ + WithCreate withProtocol(SecurityRuleProtocol protocol); + } + /** The stage of the SecurityRule definition allowing to specify sourcePortRange. */ + interface WithSourcePortRange { + /** + * Specifies the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports.. + * + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can + * also be used to match all ports. + * @return the next definition stage. + */ + WithCreate withSourcePortRange(String sourcePortRange); + } + /** The stage of the SecurityRule definition allowing to specify destinationPortRange. */ + interface WithDestinationPortRange { + /** + * Specifies the destinationPortRange property: The destination port or range. Integer or range between 0 + * and 65535. Asterisk '*' can also be used to match all ports.. + * + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + * @return the next definition stage. + */ + WithCreate withDestinationPortRange(String destinationPortRange); + } + /** The stage of the SecurityRule definition allowing to specify sourceAddressPrefix. */ + interface WithSourceAddressPrefix { + /** + * Specifies the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + * be used. If this is an ingress rule, specifies where network traffic originates from.. + * + * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @return the next definition stage. + */ + WithCreate withSourceAddressPrefix(String sourceAddressPrefix); + } + /** The stage of the SecurityRule definition allowing to specify sourceAddressPrefixes. */ + interface WithSourceAddressPrefixes { + /** + * Specifies the sourceAddressPrefixes property: The CIDR or source IP ranges.. + * + * @param sourceAddressPrefixes The CIDR or source IP ranges. + * @return the next definition stage. + */ + WithCreate withSourceAddressPrefixes(List sourceAddressPrefixes); + } + /** The stage of the SecurityRule definition allowing to specify sourceApplicationSecurityGroups. */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies the sourceApplicationSecurityGroups property: The application security group specified as + * source.. + * + * @param sourceApplicationSecurityGroups The application security group specified as source. + * @return the next definition stage. + */ + WithCreate withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups); + } + /** The stage of the SecurityRule definition allowing to specify destinationAddressPrefix. */ + interface WithDestinationAddressPrefix { + /** + * Specifies the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP + * range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used.. + * + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @return the next definition stage. + */ + WithCreate withDestinationAddressPrefix(String destinationAddressPrefix); + } + /** The stage of the SecurityRule definition allowing to specify destinationAddressPrefixes. */ + interface WithDestinationAddressPrefixes { + /** + * Specifies the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination + * IP ranges.. + * + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + WithCreate withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + /** The stage of the SecurityRule definition allowing to specify destinationApplicationSecurityGroups. */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies the destinationApplicationSecurityGroups property: The application security group specified as + * destination.. + * + * @param destinationApplicationSecurityGroups The application security group specified as destination. + * @return the next definition stage. + */ + WithCreate withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups); + } + /** The stage of the SecurityRule definition allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: The source port ranges.. + * + * @param sourcePortRanges The source port ranges. + * @return the next definition stage. + */ + WithCreate withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the SecurityRule definition allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: The destination port ranges.. + * + * @param destinationPortRanges The destination port ranges. + * @return the next definition stage. + */ + WithCreate withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the SecurityRule definition allowing to specify access. */ + interface WithAccess { + /** + * Specifies the access property: The network traffic is allowed or denied.. + * + * @param access The network traffic is allowed or denied. + * @return the next definition stage. + */ + WithCreate withAccess(SecurityRuleAccess access); + } + /** The stage of the SecurityRule definition allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher + * the priority of the rule.. + * + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of + * the rule. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + /** The stage of the SecurityRule definition allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + WithCreate withDirection(SecurityRuleDirection direction); + } + } + /** + * Begins update for the SecurityRule resource. + * + * @return the stage of resource update. + */ + SecurityRule.Update update(); + + /** The template for SecurityRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithDescription, + UpdateStages.WithProtocol, + UpdateStages.WithSourcePortRange, + UpdateStages.WithDestinationPortRange, + UpdateStages.WithSourceAddressPrefix, + UpdateStages.WithSourceAddressPrefixes, + UpdateStages.WithSourceApplicationSecurityGroups, + UpdateStages.WithDestinationAddressPrefix, + UpdateStages.WithDestinationAddressPrefixes, + UpdateStages.WithDestinationApplicationSecurityGroups, + UpdateStages.WithSourcePortRanges, + UpdateStages.WithDestinationPortRanges, + UpdateStages.WithAccess, + UpdateStages.WithPriority, + UpdateStages.WithDirection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityRule apply(Context context); + } + /** The SecurityRule update stages. */ + interface UpdateStages { + /** The stage of the SecurityRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the SecurityRule update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The type of the resource.. + * + * @param type The type of the resource. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the SecurityRule update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule. Restricted to 140 chars.. + * + * @param description A description for this rule. Restricted to 140 chars. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the SecurityRule update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Network protocol this rule applies to.. + * + * @param protocol Network protocol this rule applies to. + * @return the next definition stage. + */ + Update withProtocol(SecurityRuleProtocol protocol); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRange. */ + interface WithSourcePortRange { + /** + * Specifies the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. + * Asterisk '*' can also be used to match all ports.. + * + * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can + * also be used to match all ports. + * @return the next definition stage. + */ + Update withSourcePortRange(String sourcePortRange); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRange. */ + interface WithDestinationPortRange { + /** + * Specifies the destinationPortRange property: The destination port or range. Integer or range between 0 + * and 65535. Asterisk '*' can also be used to match all ports.. + * + * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk + * '*' can also be used to match all ports. + * @return the next definition stage. + */ + Update withDestinationPortRange(String destinationPortRange); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefix. */ + interface WithSourceAddressPrefix { + /** + * Specifies the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' can also be used to + * match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also + * be used. If this is an ingress rule, specifies where network traffic originates from.. + * + * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source + * IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + * this is an ingress rule, specifies where network traffic originates from. + * @return the next definition stage. + */ + Update withSourceAddressPrefix(String sourceAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify sourceAddressPrefixes. */ + interface WithSourceAddressPrefixes { + /** + * Specifies the sourceAddressPrefixes property: The CIDR or source IP ranges.. + * + * @param sourceAddressPrefixes The CIDR or source IP ranges. + * @return the next definition stage. + */ + Update withSourceAddressPrefixes(List sourceAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify sourceApplicationSecurityGroups. */ + interface WithSourceApplicationSecurityGroups { + /** + * Specifies the sourceApplicationSecurityGroups property: The application security group specified as + * source.. + * + * @param sourceApplicationSecurityGroups The application security group specified as source. + * @return the next definition stage. + */ + Update withSourceApplicationSecurityGroups( + List sourceApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefix. */ + interface WithDestinationAddressPrefix { + /** + * Specifies the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP + * range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used.. + * + * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk + * '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', + * 'AzureLoadBalancer' and 'Internet' can also be used. + * @return the next definition stage. + */ + Update withDestinationAddressPrefix(String destinationAddressPrefix); + } + /** The stage of the SecurityRule update allowing to specify destinationAddressPrefixes. */ + interface WithDestinationAddressPrefixes { + /** + * Specifies the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination + * IP ranges.. + * + * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + Update withDestinationAddressPrefixes(List destinationAddressPrefixes); + } + /** The stage of the SecurityRule update allowing to specify destinationApplicationSecurityGroups. */ + interface WithDestinationApplicationSecurityGroups { + /** + * Specifies the destinationApplicationSecurityGroups property: The application security group specified as + * destination.. + * + * @param destinationApplicationSecurityGroups The application security group specified as destination. + * @return the next definition stage. + */ + Update withDestinationApplicationSecurityGroups( + List destinationApplicationSecurityGroups); + } + /** The stage of the SecurityRule update allowing to specify sourcePortRanges. */ + interface WithSourcePortRanges { + /** + * Specifies the sourcePortRanges property: The source port ranges.. + * + * @param sourcePortRanges The source port ranges. + * @return the next definition stage. + */ + Update withSourcePortRanges(List sourcePortRanges); + } + /** The stage of the SecurityRule update allowing to specify destinationPortRanges. */ + interface WithDestinationPortRanges { + /** + * Specifies the destinationPortRanges property: The destination port ranges.. + * + * @param destinationPortRanges The destination port ranges. + * @return the next definition stage. + */ + Update withDestinationPortRanges(List destinationPortRanges); + } + /** The stage of the SecurityRule update allowing to specify access. */ + interface WithAccess { + /** + * Specifies the access property: The network traffic is allowed or denied.. + * + * @param access The network traffic is allowed or denied. + * @return the next definition stage. + */ + Update withAccess(SecurityRuleAccess access); + } + /** The stage of the SecurityRule update allowing to specify priority. */ + interface WithPriority { + /** + * Specifies the priority property: The priority of the rule. The value can be between 100 and 4096. The + * priority number must be unique for each rule in the collection. The lower the priority number, the higher + * the priority of the rule.. + * + * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of + * the rule. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + /** The stage of the SecurityRule update allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: The direction of the rule. The direction specifies if rule will be + * evaluated on incoming or outgoing traffic.. + * + * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming + * or outgoing traffic. + * @return the next definition stage. + */ + Update withDirection(SecurityRuleDirection direction); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java new file mode 100644 index 0000000000000..2c24baab1569e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleAccess. */ +public final class SecurityRuleAccess extends ExpandableStringEnum { + /** Static value Allow for SecurityRuleAccess. */ + public static final SecurityRuleAccess ALLOW = fromString("Allow"); + + /** Static value Deny for SecurityRuleAccess. */ + public static final SecurityRuleAccess DENY = fromString("Deny"); + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleAccess. + */ + @JsonCreator + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** @return known SecurityRuleAccess values. */ + public static Collection values() { + return values(SecurityRuleAccess.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java new file mode 100644 index 0000000000000..1931abf5ed0a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** All security rules associated with the network interface. */ +@Fluent +public final class SecurityRuleAssociations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleAssociations.class); + + /* + * Network interface and it's custom security rules. + */ + @JsonProperty(value = "networkInterfaceAssociation") + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /* + * Subnet and it's custom security rules. + */ + @JsonProperty(value = "subnetAssociation") + private SubnetAssociation subnetAssociation; + + /* + * Collection of default security rules of the network security group. + */ + @JsonProperty(value = "defaultSecurityRules") + private List defaultSecurityRules; + + /* + * Collection of effective security rules. + */ + @JsonProperty(value = "effectiveSecurityRules") + private List effectiveSecurityRules; + + /** + * Get the networkInterfaceAssociation property: Network interface and it's custom security rules. + * + * @return the networkInterfaceAssociation value. + */ + public NetworkInterfaceAssociation networkInterfaceAssociation() { + return this.networkInterfaceAssociation; + } + + /** + * Set the networkInterfaceAssociation property: Network interface and it's custom security rules. + * + * @param networkInterfaceAssociation the networkInterfaceAssociation value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withNetworkInterfaceAssociation( + NetworkInterfaceAssociation networkInterfaceAssociation) { + this.networkInterfaceAssociation = networkInterfaceAssociation; + return this; + } + + /** + * Get the subnetAssociation property: Subnet and it's custom security rules. + * + * @return the subnetAssociation value. + */ + public SubnetAssociation subnetAssociation() { + return this.subnetAssociation; + } + + /** + * Set the subnetAssociation property: Subnet and it's custom security rules. + * + * @param subnetAssociation the subnetAssociation value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withSubnetAssociation(SubnetAssociation subnetAssociation) { + this.subnetAssociation = subnetAssociation; + return this; + } + + /** + * Get the defaultSecurityRules property: Collection of default security rules of the network security group. + * + * @return the defaultSecurityRules value. + */ + public List defaultSecurityRules() { + return this.defaultSecurityRules; + } + + /** + * Set the defaultSecurityRules property: Collection of default security rules of the network security group. + * + * @param defaultSecurityRules the defaultSecurityRules value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withDefaultSecurityRules(List defaultSecurityRules) { + this.defaultSecurityRules = defaultSecurityRules; + return this; + } + + /** + * Get the effectiveSecurityRules property: Collection of effective security rules. + * + * @return the effectiveSecurityRules value. + */ + public List effectiveSecurityRules() { + return this.effectiveSecurityRules; + } + + /** + * Set the effectiveSecurityRules property: Collection of effective security rules. + * + * @param effectiveSecurityRules the effectiveSecurityRules value to set. + * @return the SecurityRuleAssociations object itself. + */ + public SecurityRuleAssociations withEffectiveSecurityRules( + List effectiveSecurityRules) { + this.effectiveSecurityRules = effectiveSecurityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaceAssociation() != null) { + networkInterfaceAssociation().validate(); + } + if (subnetAssociation() != null) { + subnetAssociation().validate(); + } + if (defaultSecurityRules() != null) { + defaultSecurityRules().forEach(e -> e.validate()); + } + if (effectiveSecurityRules() != null) { + effectiveSecurityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java new file mode 100644 index 0000000000000..d1ade3eda5d59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleDirection. */ +public final class SecurityRuleDirection extends ExpandableStringEnum { + /** Static value Inbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for SecurityRuleDirection. */ + public static final SecurityRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleDirection. + */ + @JsonCreator + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** @return known SecurityRuleDirection values. */ + public static Collection values() { + return values(SecurityRuleDirection.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java new file mode 100644 index 0000000000000..cd0c0e1cc62d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security + * group. + */ +@Fluent +public final class SecurityRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityRuleListResult.class); + + /* + * The security rules in a network security group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The security rules in a network security group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The security rules in a network security group. + * + * @param value the value value to set. + * @return the SecurityRuleListResult object itself. + */ + public SecurityRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityRuleListResult object itself. + */ + public SecurityRuleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java new file mode 100644 index 0000000000000..dc37004dc56dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityRuleProtocol. */ +public final class SecurityRuleProtocol extends ExpandableStringEnum { + /** Static value Tcp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol TCP = fromString("Tcp"); + + /** Static value Udp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol UDP = fromString("Udp"); + + /** Static value Icmp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ICMP = fromString("Icmp"); + + /** Static value Esp for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ESP = fromString("Esp"); + + /** Static value * for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol ASTERISK = fromString("*"); + + /** Static value Ah for SecurityRuleProtocol. */ + public static final SecurityRuleProtocol AH = fromString("Ah"); + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleProtocol. + */ + @JsonCreator + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** @return known SecurityRuleProtocol values. */ + public static Collection values() { + return values(SecurityRuleProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java new file mode 100644 index 0000000000000..01600785ee443 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SecurityRules. */ +public interface SecurityRules { + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule. + */ + SecurityRule get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName); + + /** + * Get the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkSecurityGroupName, String securityRuleName, Context context); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName); + + /** + * Gets all security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all security rules in a network security group. + */ + PagedIterable list(String resourceGroupName, String networkSecurityGroupName, Context context); + + /** + * Get the specified network security rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified network security rule 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..50226f264f5c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinkPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ServiceAssociationLink resource. */ +@Fluent +public final class ServiceAssociationLink extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceAssociationLink.class); + + /* + * 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; + + /** + * 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..a9371b5ad2650 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceAssociationLinks. */ +public interface ServiceAssociationLinks { + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet. + */ + ServiceAssociationLinksListResult list(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets a list of service association links for a subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service association links for a subnet along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java new file mode 100644 index 0000000000000..673ba5c9acc07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceAssociationLinksListResult. */ +public interface ServiceAssociationLinksListResult { + /** + * Gets the value property: The service association links in a subnet. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinksListResultInner + * object. + * + * @return the inner object. + */ + ServiceAssociationLinksListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java new file mode 100644 index 0000000000000..8e9e39cf4331a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceEndpointPolicies. */ +public interface ServiceEndpointPolicies { + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Deletes the specified service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceEndpointPolicyName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group. + */ + ServiceEndpointPolicy getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceEndpointPolicyName, String expand, Context context); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the service endpoint policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the service endpoint policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all service endpoint Policies in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint Policies in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the specified service Endpoint Policies in a specified resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service Endpoint Policies in a specified resource group 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..8191314afac10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 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..1f05e4bda7d66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.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 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..52267d28b7672 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition + * that belongs to a service endpoint policy. + */ +@Fluent +public final class ServiceEndpointPolicyDefinitionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyDefinitionListResult.class); + + /* + * The service endpoint policy definition in a service endpoint policy. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The service endpoint policy definition in a service endpoint policy. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The service endpoint policy definition in a service endpoint policy. + * + * @param value the value value to set. + * @return the ServiceEndpointPolicyDefinitionListResult object itself. + */ + public ServiceEndpointPolicyDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ServiceEndpointPolicyDefinitionListResult object itself. + */ + public ServiceEndpointPolicyDefinitionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java new file mode 100644 index 0000000000000..9d41ab379bfbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.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 ServiceEndpointPolicyDefinitions. */ +public interface ServiceEndpointPolicyDefinitions { + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the Service Endpoint Policy. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy. + */ + ServiceEndpointPolicyDefinition get( + String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName); + + /** + * Get the specified service endpoint policy definitions from service endpoint policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param serviceEndpointPolicyDefinitionName The name of the service endpoint policy definition name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified service endpoint policy definitions from service endpoint policy along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, + String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + Context context); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName); + + /** + * Gets all service endpoint policy definitions in a service end point policy. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all service endpoint policy definitions in a service end point policy. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String serviceEndpointPolicyName, Context context); + + /** + * 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..49a35ea2664ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListServiceEndpointPolicies API service call. */ +@Fluent +public final class ServiceEndpointPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPolicyListResult.class); + + /* + * A list of ServiceEndpointPolicy resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of ServiceEndpointPolicy resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ServiceEndpointPolicy resources. + * + * @param value the value value to set. + * @return the ServiceEndpointPolicyListResult object itself. + */ + public ServiceEndpointPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java new file mode 100644 index 0000000000000..c038f71a57b27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The service endpoint properties. */ +@Fluent +public final class ServiceEndpointPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceEndpointPropertiesFormat.class); + + /* + * The type of the endpoint service. + */ + @JsonProperty(value = "service") + private String service; + + /* + * A list of locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The provisioning state of the service endpoint resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the service property: The type of the endpoint service. + * + * @return the service value. + */ + public String service() { + return this.service; + } + + /** + * Set the service property: The type of the endpoint service. + * + * @param service the service value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withService(String service) { + this.service = service; + return this; + } + + /** + * Get the locations property: A list of locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A list of locations. + * + * @param locations the locations value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java new file mode 100644 index 0000000000000..a0c2e8931ff31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceProviderProvisioningState. */ +public final class ServiceProviderProvisioningState extends ExpandableStringEnum { + /** Static value NotProvisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState NOT_PROVISIONED = fromString("NotProvisioned"); + + /** Static value Provisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for ServiceProviderProvisioningState. */ + public static final ServiceProviderProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceProviderProvisioningState. + */ + @JsonCreator + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** @return known ServiceProviderProvisioningState values. */ + public static Collection values() { + return values(ServiceProviderProvisioningState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.java new file mode 100644 index 0000000000000..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..365432f79c63b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagInformationListResult.class); + + /* + * 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; + + /** + * 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..69e5bcffad736 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the service tag information. */ +@Immutable +public final class ServiceTagInformationPropertiesFormat { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTagInformationPropertiesFormat.class); + + /* + * The iteration number of service tag. + */ + @JsonProperty(value = "changeNumber", access = JsonProperty.Access.WRITE_ONLY) + private String changeNumber; + + /* + * The region of service tag. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The name of system service. + */ + @JsonProperty(value = "systemService", access = JsonProperty.Access.WRITE_ONLY) + private String systemService; + + /* + * The list of IP address prefixes. + */ + @JsonProperty(value = "addressPrefixes", access = JsonProperty.Access.WRITE_ONLY) + private List addressPrefixes; + + /* + * The state of the service tag. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the changeNumber property: The iteration number of service tag. + * + * @return the changeNumber value. + */ + public String changeNumber() { + return this.changeNumber; + } + + /** + * Get the region property: The region of service tag. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the systemService property: The name of system service. + * + * @return the systemService value. + */ + public String systemService() { + return this.systemService; + } + + /** + * Get the addressPrefixes property: The list of IP address prefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the state property: The state of the service tag. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..fffffa4e79649 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of 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. + */ + 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. + */ + 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..c786773d067d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceTags. */ +public interface ServiceTags { + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources. + */ + ServiceTagsListResult list(String location); + + /** + * Gets a list of service tag information resources. + * + * @param location The location that will be used as a reference for version (not as a filter based on location, you + * will get the list of service tags with prefix details across all regions but limited to the cloud that your + * subscription belongs to). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of service tag information resources along with {@link Response}. + */ + Response listWithResponse(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java new file mode 100644 index 0000000000000..96ad8929674a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner; +import java.util.List; + +/** An immutable client-side representation of ServiceTagsListResult. */ +public interface ServiceTagsListResult { + /** + * Gets the name property: The name of the cloud. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of the cloud. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: The azure resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the changeNumber property: The iteration number. + * + * @return the changeNumber value. + */ + String changeNumber(); + + /** + * Gets the cloud property: The name of the cloud. + * + * @return the cloud value. + */ + String cloud(); + + /** + * Gets the values property: The list of service tag information resources. + * + * @return the values value. + */ + List values(); + + /** + * Gets the nextLink property: The URL to get next page of service tag information resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceTagsListResultInner object. + * + * @return the inner object. + */ + ServiceTagsListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java new file mode 100644 index 0000000000000..b8d77f35a8e95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of session IDs. */ +@Fluent +public final class SessionIds { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SessionIds.class); + + /* + * List of session IDs. + */ + @JsonProperty(value = "sessionIds") + private List sessionIds; + + /** + * Get the sessionIds property: List of session IDs. + * + * @return the sessionIds value. + */ + public List sessionIds() { + return this.sessionIds; + } + + /** + * Set the sessionIds property: List of session IDs. + * + * @param sessionIds the sessionIds value to set. + * @return the SessionIds object itself. + */ + public SessionIds withSessionIds(List sessionIds) { + this.sessionIds = sessionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java new file mode 100644 index 0000000000000..f9fee8cb9b288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Severity. */ +public final class Severity extends ExpandableStringEnum { + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** @return known Severity values. */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..e3c9d7ad6b37b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the filter values possibles for a given column. */ +@Fluent +public final class SignatureOverridesFilterValuesQuery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignatureOverridesFilterValuesQuery.class); + + /* + * Describes the name of the column which values will be returned + */ + @JsonProperty(value = "filterName") + private String filterName; + + /** + * 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..4ed88505ddf47 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignaturesOverridesProperties.class); + + /* + * Dictionary of + */ + @JsonProperty(value = "signatures") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map signatures; + + /** + * 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..32af83e182310 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SingleQueryResult model. */ +@Fluent +public final class SingleQueryResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SingleQueryResult.class); + + /* + * 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 SingleQueryResultMode mode; + + /* + * Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High + */ + @JsonProperty(value = "severity") + private SingleQueryResultSeverity severity; + + /* + * Describes in which direction signature is being enforced: 0 - Inbound, 1 + * - OutBound, 2 - Bidirectional + */ + @JsonProperty(value = "direction") + private SingleQueryResultDirection 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; + + /** + * 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 SingleQueryResultMode 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(SingleQueryResultMode 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 SingleQueryResultSeverity 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(SingleQueryResultSeverity 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 SingleQueryResultDirection 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(SingleQueryResultDirection 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/SingleQueryResultDirection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultDirection.java new file mode 100644 index 0000000000000..a6d573c4993fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultDirection.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SingleQueryResultDirection. */ +public final class SingleQueryResultDirection extends ExpandableStringEnum { + /** Static value 0 for SingleQueryResultDirection. */ + public static final SingleQueryResultDirection ZERO = fromInt(0); + + /** Static value 1 for SingleQueryResultDirection. */ + public static final SingleQueryResultDirection ONE = fromInt(1); + + /** Static value 2 for SingleQueryResultDirection. */ + public static final SingleQueryResultDirection TWO = fromInt(2); + + /** + * Creates or finds a SingleQueryResultDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SingleQueryResultDirection. + */ + @JsonCreator + public static SingleQueryResultDirection fromInt(int name) { + return fromString(String.valueOf(name), SingleQueryResultDirection.class); + } + + /** @return known SingleQueryResultDirection values. */ + public static Collection values() { + return values(SingleQueryResultDirection.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultMode.java new file mode 100644 index 0000000000000..07a1fcde5b86b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SingleQueryResultMode. */ +public final class SingleQueryResultMode extends ExpandableStringEnum { + /** Static value 0 for SingleQueryResultMode. */ + public static final SingleQueryResultMode ZERO = fromInt(0); + + /** Static value 1 for SingleQueryResultMode. */ + public static final SingleQueryResultMode ONE = fromInt(1); + + /** Static value 2 for SingleQueryResultMode. */ + public static final SingleQueryResultMode TWO = fromInt(2); + + /** + * Creates or finds a SingleQueryResultMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SingleQueryResultMode. + */ + @JsonCreator + public static SingleQueryResultMode fromInt(int name) { + return fromString(String.valueOf(name), SingleQueryResultMode.class); + } + + /** @return known SingleQueryResultMode values. */ + public static Collection values() { + return values(SingleQueryResultMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultSeverity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultSeverity.java new file mode 100644 index 0000000000000..e45da20ab5fb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResultSeverity.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SingleQueryResultSeverity. */ +public final class SingleQueryResultSeverity extends ExpandableStringEnum { + /** Static value 1 for SingleQueryResultSeverity. */ + public static final SingleQueryResultSeverity ONE = fromInt(1); + + /** Static value 2 for SingleQueryResultSeverity. */ + public static final SingleQueryResultSeverity TWO = fromInt(2); + + /** Static value 3 for SingleQueryResultSeverity. */ + public static final SingleQueryResultSeverity THREE = fromInt(3); + + /** + * Creates or finds a SingleQueryResultSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding SingleQueryResultSeverity. + */ + @JsonCreator + public static SingleQueryResultSeverity fromInt(int name) { + return fromString(String.valueOf(name), SingleQueryResultSeverity.class); + } + + /** @return known SingleQueryResultSeverity values. */ + public static Collection values() { + return values(SingleQueryResultSeverity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java new file mode 100644 index 0000000000000..23a3bdde25419 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The sku of this Bastion Host. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The name of this Bastion Host. + */ + @JsonProperty(value = "name") + private BastionHostSkuName name; + + /** + * Get the name property: The name of this Bastion Host. + * + * @return the name value. + */ + public BastionHostSkuName name() { + return this.name; + } + + /** + * Set the name property: The name of this Bastion Host. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(BastionHostSkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java new file mode 100644 index 0000000000000..9ecd334e6554f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all Static Routes. */ +@Fluent +public final class StaticRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StaticRoute.class); + + /* + * The name of the StaticRoute that is unique within a VnetRoute. + */ + @JsonProperty(value = "name") + private String name; + + /* + * List of all address prefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * The ip address of the next hop. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get the name property: The name of the StaticRoute that is unique within a VnetRoute. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the StaticRoute that is unique within a VnetRoute. + * + * @param name the name value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withName(String name) { + this.name = name; + return this; + } + + /** + * Get the addressPrefixes property: List of all address prefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of all address prefixes. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the nextHopIpAddress property: The ip address of the next hop. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: The ip address of the next hop. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the StaticRoute object itself. + */ + public StaticRoute withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java new file mode 100644 index 0000000000000..8ab525eff8a53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java @@ -0,0 +1,650 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import java.util.List; + +/** An immutable client-side representation of Subnet. */ +public interface Subnet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: The address prefix for the subnet. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the addressPrefixes property: List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + List addressPrefixes(); + + /** + * Gets the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + NetworkSecurityGroup networkSecurityGroup(); + + /** + * Gets the routeTable property: The reference to the RouteTable resource. + * + * @return the routeTable value. + */ + RouteTable routeTable(); + + /** + * Gets the natGateway property: Nat gateway associated with this subnet. + * + * @return the natGateway value. + */ + SubResource natGateway(); + + /** + * Gets the serviceEndpoints property: An array of service endpoints. + * + * @return the serviceEndpoints value. + */ + List serviceEndpoints(); + + /** + * Gets the serviceEndpointPolicies property: An array of service endpoint policies. + * + * @return the serviceEndpointPolicies value. + */ + List serviceEndpointPolicies(); + + /** + * Gets the privateEndpoints property: An array of references to private endpoints. + * + * @return the privateEndpoints value. + */ + List privateEndpoints(); + + /** + * Gets the ipConfigurations property: An array of references to the network interface IP configurations using + * subnet. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value. + */ + List ipConfigurationProfiles(); + + /** + * Gets the ipAllocations property: Array of IpAllocation which reference this subnet. + * + * @return the ipAllocations value. + */ + List ipAllocations(); + + /** + * Gets the resourceNavigationLinks property: An array of references to the external resources using subnet. + * + * @return the resourceNavigationLinks value. + */ + List resourceNavigationLinks(); + + /** + * Gets the serviceAssociationLinks property: An array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value. + */ + List serviceAssociationLinks(); + + /** + * Gets the delegations property: An array of references to the delegations on the subnet. + * + * @return the delegations value. + */ + List delegations(); + + /** + * Gets the purpose property: A read-only string identifying the intention of use for this subnet based on + * delegations and other user-defined properties. + * + * @return the purpose value. + */ + String purpose(); + + /** + * Gets the provisioningState property: The provisioning state of the subnet resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on private end point + * in the subnet. + * + * @return the privateEndpointNetworkPolicies value. + */ + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies(); + + /** + * Gets the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on private link + * service in the subnet. + * + * @return the privateLinkServiceNetworkPolicies value. + */ + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies(); + + /** + * Gets the applicationGatewayIpConfigurations property: Application gateway IP configurations of virtual network + * resource. + * + * @return the applicationGatewayIpConfigurations value. + */ + List applicationGatewayIpConfigurations(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SubnetInner object. + * + * @return the inner object. + */ + SubnetInner innerModel(); + + /** The entirety of the Subnet definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Subnet definition stages. */ + interface DefinitionStages { + /** The first stage of the Subnet definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Subnet definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + /** + * The stage of the Subnet definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithAddressPrefixes, + DefinitionStages.WithNetworkSecurityGroup, + DefinitionStages.WithRouteTable, + DefinitionStages.WithNatGateway, + DefinitionStages.WithServiceEndpoints, + DefinitionStages.WithServiceEndpointPolicies, + DefinitionStages.WithIpAllocations, + DefinitionStages.WithDelegations, + DefinitionStages.WithPrivateEndpointNetworkPolicies, + DefinitionStages.WithPrivateLinkServiceNetworkPolicies, + DefinitionStages.WithApplicationGatewayIpConfigurations { + /** + * Executes the create request. + * + * @return the created resource. + */ + Subnet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Subnet create(Context context); + } + /** The stage of the Subnet definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the Subnet definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the Subnet definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet definition allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + WithCreate withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet definition allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + WithCreate withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet definition allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + WithCreate withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet definition allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + WithCreate withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet definition allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + WithCreate withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet definition allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + WithCreate withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet definition allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + WithCreate withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet definition allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + WithCreate withDelegations(List delegations); + } + /** The stage of the Subnet definition allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet definition allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + WithCreate withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Begins update for the Subnet resource. + * + * @return the stage of resource update. + */ + Subnet.Update update(); + + /** The template for Subnet update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAddressPrefix, + UpdateStages.WithAddressPrefixes, + UpdateStages.WithNetworkSecurityGroup, + UpdateStages.WithRouteTable, + UpdateStages.WithNatGateway, + UpdateStages.WithServiceEndpoints, + UpdateStages.WithServiceEndpointPolicies, + UpdateStages.WithIpAllocations, + UpdateStages.WithDelegations, + UpdateStages.WithPrivateEndpointNetworkPolicies, + UpdateStages.WithPrivateLinkServiceNetworkPolicies, + UpdateStages.WithApplicationGatewayIpConfigurations { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Subnet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Subnet apply(Context context); + } + /** The Subnet update stages. */ + interface UpdateStages { + /** The stage of the Subnet update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the Subnet update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the Subnet update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: The address prefix for the subnet.. + * + * @param addressPrefix The address prefix for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the Subnet update allowing to specify addressPrefixes. */ + interface WithAddressPrefixes { + /** + * Specifies the addressPrefixes property: List of address prefixes for the subnet.. + * + * @param addressPrefixes List of address prefixes for the subnet. + * @return the next definition stage. + */ + Update withAddressPrefixes(List addressPrefixes); + } + /** The stage of the Subnet update allowing to specify networkSecurityGroup. */ + interface WithNetworkSecurityGroup { + /** + * Specifies the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource.. + * + * @param networkSecurityGroup The reference to the NetworkSecurityGroup resource. + * @return the next definition stage. + */ + Update withNetworkSecurityGroup(NetworkSecurityGroupInner networkSecurityGroup); + } + /** The stage of the Subnet update allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The reference to the RouteTable resource.. + * + * @param routeTable The reference to the RouteTable resource. + * @return the next definition stage. + */ + Update withRouteTable(RouteTableInner routeTable); + } + /** The stage of the Subnet update allowing to specify natGateway. */ + interface WithNatGateway { + /** + * Specifies the natGateway property: Nat gateway associated with this subnet.. + * + * @param natGateway Nat gateway associated with this subnet. + * @return the next definition stage. + */ + Update withNatGateway(SubResource natGateway); + } + /** The stage of the Subnet update allowing to specify serviceEndpoints. */ + interface WithServiceEndpoints { + /** + * Specifies the serviceEndpoints property: An array of service endpoints.. + * + * @param serviceEndpoints An array of service endpoints. + * @return the next definition stage. + */ + Update withServiceEndpoints(List serviceEndpoints); + } + /** The stage of the Subnet update allowing to specify serviceEndpointPolicies. */ + interface WithServiceEndpointPolicies { + /** + * Specifies the serviceEndpointPolicies property: An array of service endpoint policies.. + * + * @param serviceEndpointPolicies An array of service endpoint policies. + * @return the next definition stage. + */ + Update withServiceEndpointPolicies(List serviceEndpointPolicies); + } + /** The stage of the Subnet update allowing to specify ipAllocations. */ + interface WithIpAllocations { + /** + * Specifies the ipAllocations property: Array of IpAllocation which reference this subnet.. + * + * @param ipAllocations Array of IpAllocation which reference this subnet. + * @return the next definition stage. + */ + Update withIpAllocations(List ipAllocations); + } + /** The stage of the Subnet update allowing to specify delegations. */ + interface WithDelegations { + /** + * Specifies the delegations property: An array of references to the delegations on the subnet.. + * + * @param delegations An array of references to the delegations on the subnet. + * @return the next definition stage. + */ + Update withDelegations(List delegations); + } + /** The stage of the Subnet update allowing to specify privateEndpointNetworkPolicies. */ + interface WithPrivateEndpointNetworkPolicies { + /** + * Specifies the privateEndpointNetworkPolicies property: Enable or Disable apply network policies on + * private end point in the subnet.. + * + * @param privateEndpointNetworkPolicies Enable or Disable apply network policies on private end point in + * the subnet. + * @return the next definition stage. + */ + Update withPrivateEndpointNetworkPolicies( + VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify privateLinkServiceNetworkPolicies. */ + interface WithPrivateLinkServiceNetworkPolicies { + /** + * Specifies the privateLinkServiceNetworkPolicies property: Enable or Disable apply network policies on + * private link service in the subnet.. + * + * @param privateLinkServiceNetworkPolicies Enable or Disable apply network policies on private link service + * in the subnet. + * @return the next definition stage. + */ + Update withPrivateLinkServiceNetworkPolicies( + VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies); + } + /** The stage of the Subnet update allowing to specify applicationGatewayIpConfigurations. */ + interface WithApplicationGatewayIpConfigurations { + /** + * Specifies the applicationGatewayIpConfigurations property: Application gateway IP configurations of + * virtual network resource.. + * + * @param applicationGatewayIpConfigurations Application gateway IP configurations of virtual network + * resource. + * @return the next definition stage. + */ + Update withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Subnet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Subnet refresh(Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies(PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies(UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies( + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java new file mode 100644 index 0000000000000..8138795c94b8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet and it's custom security rules. */ +@Fluent +public final class SubnetAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetAssociation.class); + + /* + * Subnet ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Collection of custom security rules. + */ + @JsonProperty(value = "securityRules") + private List securityRules; + + /** + * Get the id property: Subnet ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the securityRules property: Collection of custom security rules. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.securityRules; + } + + /** + * Set the securityRules property: Collection of custom security rules. + * + * @param securityRules the securityRules value to set. + * @return the SubnetAssociation object itself. + */ + public SubnetAssociation withSecurityRules(List securityRules) { + this.securityRules = securityRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityRules() != null) { + securityRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java new file mode 100644 index 0000000000000..20a15a9964366 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. */ +@Fluent +public final class SubnetListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetListResult.class); + + /* + * The subnets in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The subnets in a virtual network. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The subnets in a virtual network. + * + * @param value the value value to set. + * @return the SubnetListResult object itself. + */ + public SubnetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SubnetListResult object itself. + */ + public SubnetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..d2b67f5aaf357 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Subnets. */ +public interface Subnets { + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group. + */ + Subnet get(String resourceGroupName, String virtualNetworkName, String subnetName); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String subnetName, String expand, Context context); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters); + + /** + * Prepares a subnet by applying network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param prepareNetworkPoliciesRequestParameters Parameters supplied to prepare subnet by applying network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void prepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters); + + /** + * Unprepares a subnet by removing network intent policies. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param unprepareNetworkPoliciesRequestParameters Parameters supplied to unprepare subnet to remove network intent + * policies. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void unprepareNetworkPolicies( + String resourceGroupName, + String virtualNetworkName, + String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, + Context context); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all subnets in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified subnet by virtual network and resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified subnet by virtual network and resource group 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/SyncRemoteAddressSpace.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java new file mode 100644 index 0000000000000..6d15a21080667 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SyncRemoteAddressSpace. */ +public final class SyncRemoteAddressSpace extends ExpandableStringEnum { + /** Static value true for SyncRemoteAddressSpace. */ + public static final SyncRemoteAddressSpace TRUE = fromString("true"); + + /** + * Creates or finds a SyncRemoteAddressSpace from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncRemoteAddressSpace. + */ + @JsonCreator + public static SyncRemoteAddressSpace fromString(String name) { + return fromString(name, SyncRemoteAddressSpace.class); + } + + /** @return known SyncRemoteAddressSpace values. */ + public static Collection values() { + return values(SyncRemoteAddressSpace.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java new file mode 100644 index 0000000000000..18f02d0fc8415 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java new file mode 100644 index 0000000000000..5cab2dbe7ab52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TopologyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Topology. */ +public interface Topology { + /** + * Gets the id property: GUID representing the operation id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the createdDateTime property: The datetime when the topology was initially created for the resource group. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the lastModified property: The datetime when the topology was last modified. + * + * @return the lastModified value. + */ + OffsetDateTime lastModified(); + + /** + * Gets the resources property: A list of topology resources. + * + * @return the resources value. + */ + List resources(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TopologyInner object. + * + * @return the inner object. + */ + TopologyInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java new file mode 100644 index 0000000000000..145717c78ec14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resources that have an association with the parent resource. */ +@Fluent +public final class TopologyAssociation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyAssociation.class); + + /* + * The name of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The ID of the resource that is associated with the parent resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The association type of the child resource to the parent resource. + */ + @JsonProperty(value = "associationType") + private AssociationType associationType; + + /** + * Get the name property: The name of the resource that is associated with the parent resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is associated with the parent resource. + * + * @param name the name value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resourceId property: The ID of the resource that is associated with the parent resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the resource that is associated with the parent resource. + * + * @param resourceId the resourceId value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the associationType property: The association type of the child resource to the parent resource. + * + * @return the associationType value. + */ + public AssociationType associationType() { + return this.associationType; + } + + /** + * Set the associationType property: The association type of the child resource to the parent resource. + * + * @param associationType the associationType value to set. + * @return the TopologyAssociation object itself. + */ + public TopologyAssociation withAssociationType(AssociationType associationType) { + this.associationType = associationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java new file mode 100644 index 0000000000000..6a92e8c2f962a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the representation of topology. */ +@Fluent +public final class TopologyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyParameters.class); + + /* + * The name of the target resource group to perform topology on. + */ + @JsonProperty(value = "targetResourceGroupName") + private String targetResourceGroupName; + + /* + * The reference to the Virtual Network resource. + */ + @JsonProperty(value = "targetVirtualNetwork") + private SubResource targetVirtualNetwork; + + /* + * The reference to the Subnet resource. + */ + @JsonProperty(value = "targetSubnet") + private SubResource targetSubnet; + + /** + * Get the targetResourceGroupName property: The name of the target resource group to perform topology on. + * + * @return the targetResourceGroupName value. + */ + public String targetResourceGroupName() { + return this.targetResourceGroupName; + } + + /** + * Set the targetResourceGroupName property: The name of the target resource group to perform topology on. + * + * @param targetResourceGroupName the targetResourceGroupName value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetResourceGroupName(String targetResourceGroupName) { + this.targetResourceGroupName = targetResourceGroupName; + return this; + } + + /** + * Get the targetVirtualNetwork property: The reference to the Virtual Network resource. + * + * @return the targetVirtualNetwork value. + */ + public SubResource targetVirtualNetwork() { + return this.targetVirtualNetwork; + } + + /** + * Set the targetVirtualNetwork property: The reference to the Virtual Network resource. + * + * @param targetVirtualNetwork the targetVirtualNetwork value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetVirtualNetwork(SubResource targetVirtualNetwork) { + this.targetVirtualNetwork = targetVirtualNetwork; + return this; + } + + /** + * Get the targetSubnet property: The reference to the Subnet resource. + * + * @return the targetSubnet value. + */ + public SubResource targetSubnet() { + return this.targetSubnet; + } + + /** + * Set the targetSubnet property: The reference to the Subnet resource. + * + * @param targetSubnet the targetSubnet value to set. + * @return the TopologyParameters object itself. + */ + public TopologyParameters withTargetSubnet(SubResource targetSubnet) { + this.targetSubnet = targetSubnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java new file mode 100644 index 0000000000000..8c5057604c6b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network resource topology information for the given resource group. */ +@Fluent +public final class TopologyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopologyResource.class); + + /* + * Name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Holds the associations the resource has with other resources in the + * resource group. + */ + @JsonProperty(value = "associations") + private List associations; + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the resource. + * + * @param id the id value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the associations property: Holds the associations the resource has with other resources in the resource + * group. + * + * @return the associations value. + */ + public List associations() { + return this.associations; + } + + /** + * Set the associations property: Holds the associations the resource has with other resources in the resource + * group. + * + * @param associations the associations value to set. + * @return the TopologyResource object itself. + */ + public TopologyResource withAssociations(List associations) { + this.associations = associations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associations() != null) { + associations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java new file mode 100644 index 0000000000000..d35f90884f7d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsConfigurationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsConfigurationProperties.class); + + /* + * Flag to enable/disable traffic analytics. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The resource guid of the attached workspace. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The location of the attached workspace. + */ + @JsonProperty(value = "workspaceRegion") + private String workspaceRegion; + + /* + * Resource Id of the attached workspace. + */ + @JsonProperty(value = "workspaceResourceId") + private String workspaceResourceId; + + /* + * The interval in minutes which would decide how frequently TA service + * should do flow analytics. + */ + @JsonProperty(value = "trafficAnalyticsInterval") + private Integer trafficAnalyticsInterval; + + /** + * Get the enabled property: Flag to enable/disable traffic analytics. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Flag to enable/disable traffic analytics. + * + * @param enabled the enabled value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workspaceId property: The resource guid of the attached workspace. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The resource guid of the attached workspace. + * + * @param workspaceId the workspaceId value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspaceRegion property: The location of the attached workspace. + * + * @return the workspaceRegion value. + */ + public String workspaceRegion() { + return this.workspaceRegion; + } + + /** + * Set the workspaceRegion property: The location of the attached workspace. + * + * @param workspaceRegion the workspaceRegion value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceRegion(String workspaceRegion) { + this.workspaceRegion = workspaceRegion; + return this; + } + + /** + * Get the workspaceResourceId property: Resource Id of the attached workspace. + * + * @return the workspaceResourceId value. + */ + public String workspaceResourceId() { + return this.workspaceResourceId; + } + + /** + * Set the workspaceResourceId property: Resource Id of the attached workspace. + * + * @param workspaceResourceId the workspaceResourceId value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withWorkspaceResourceId(String workspaceResourceId) { + this.workspaceResourceId = workspaceResourceId; + return this; + } + + /** + * Get the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service + * should do flow analytics. + * + * @return the trafficAnalyticsInterval value. + */ + public Integer trafficAnalyticsInterval() { + return this.trafficAnalyticsInterval; + } + + /** + * Set the trafficAnalyticsInterval property: The interval in minutes which would decide how frequently TA service + * should do flow analytics. + * + * @param trafficAnalyticsInterval the trafficAnalyticsInterval value to set. + * @return the TrafficAnalyticsConfigurationProperties object itself. + */ + public TrafficAnalyticsConfigurationProperties withTrafficAnalyticsInterval(Integer trafficAnalyticsInterval) { + this.trafficAnalyticsInterval = trafficAnalyticsInterval; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java new file mode 100644 index 0000000000000..8d9ed17473da8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the configuration of traffic analytics. */ +@Fluent +public final class TrafficAnalyticsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficAnalyticsProperties.class); + + /* + * Parameters that define the configuration of traffic analytics. + */ + @JsonProperty(value = "networkWatcherFlowAnalyticsConfiguration") + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Get the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics. + * + * @return the networkWatcherFlowAnalyticsConfiguration value. + */ + public TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration() { + return this.networkWatcherFlowAnalyticsConfiguration; + } + + /** + * Set the networkWatcherFlowAnalyticsConfiguration property: Parameters that define the configuration of traffic + * analytics. + * + * @param networkWatcherFlowAnalyticsConfiguration the networkWatcherFlowAnalyticsConfiguration value to set. + * @return the TrafficAnalyticsProperties object itself. + */ + public TrafficAnalyticsProperties withNetworkWatcherFlowAnalyticsConfiguration( + TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration) { + this.networkWatcherFlowAnalyticsConfiguration = networkWatcherFlowAnalyticsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkWatcherFlowAnalyticsConfiguration() != null) { + networkWatcherFlowAnalyticsConfiguration().validate(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java new file mode 100644 index 0000000000000..b3cc6313ad490 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An traffic selector policy for a virtual network gateway connection. */ +@Fluent +public final class TrafficSelectorPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficSelectorPolicy.class); + + /* + * A collection of local address spaces in CIDR format. + */ + @JsonProperty(value = "localAddressRanges", required = true) + private List localAddressRanges; + + /* + * A collection of remote address spaces in CIDR format. + */ + @JsonProperty(value = "remoteAddressRanges", required = true) + private List remoteAddressRanges; + + /** + * Get the localAddressRanges property: A collection of local address spaces in CIDR format. + * + * @return the localAddressRanges value. + */ + public List localAddressRanges() { + return this.localAddressRanges; + } + + /** + * Set the localAddressRanges property: A collection of local address spaces in CIDR format. + * + * @param localAddressRanges the localAddressRanges value to set. + * @return the TrafficSelectorPolicy object itself. + */ + public TrafficSelectorPolicy withLocalAddressRanges(List localAddressRanges) { + this.localAddressRanges = localAddressRanges; + return this; + } + + /** + * Get the remoteAddressRanges property: A collection of remote address spaces in CIDR format. + * + * @return the remoteAddressRanges value. + */ + public List remoteAddressRanges() { + return this.remoteAddressRanges; + } + + /** + * Set the remoteAddressRanges property: A collection of remote address spaces in CIDR format. + * + * @param remoteAddressRanges the remoteAddressRanges value to set. + * @return the TrafficSelectorPolicy object itself. + */ + public TrafficSelectorPolicy withRemoteAddressRanges(List remoteAddressRanges) { + this.remoteAddressRanges = remoteAddressRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (localAddressRanges() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localAddressRanges in model TrafficSelectorPolicy")); + } + if (remoteAddressRanges() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteAddressRanges in model TrafficSelectorPolicy")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java new file mode 100644 index 0000000000000..e1e0cc7b117d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TransportProtocol. */ +public final class TransportProtocol extends ExpandableStringEnum { + /** Static value Udp for TransportProtocol. */ + public static final TransportProtocol UDP = fromString("Udp"); + + /** Static value Tcp for TransportProtocol. */ + public static final TransportProtocol TCP = fromString("Tcp"); + + /** Static value All for TransportProtocol. */ + public static final TransportProtocol ALL = fromString("All"); + + /** + * Creates or finds a TransportProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransportProtocol. + */ + @JsonCreator + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** @return known TransportProtocol values. */ + public static Collection values() { + return values(TransportProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java new file mode 100644 index 0000000000000..973ecd1422a5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information gained from troubleshooting of specified resource. */ +@Fluent +public final class TroubleshootingDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingDetails.class); + + /* + * The id of the get troubleshoot operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Reason type of failure. + */ + @JsonProperty(value = "reasonType") + private String reasonType; + + /* + * A summary of troubleshooting. + */ + @JsonProperty(value = "summary") + private String summary; + + /* + * Details on troubleshooting results. + */ + @JsonProperty(value = "detail") + private String detail; + + /* + * List of recommended actions. + */ + @JsonProperty(value = "recommendedActions") + private List recommendedActions; + + /** + * Get the id property: The id of the get troubleshoot operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id of the get troubleshoot operation. + * + * @param id the id value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the reasonType property: Reason type of failure. + * + * @return the reasonType value. + */ + public String reasonType() { + return this.reasonType; + } + + /** + * Set the reasonType property: Reason type of failure. + * + * @param reasonType the reasonType value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withReasonType(String reasonType) { + this.reasonType = reasonType; + return this; + } + + /** + * Get the summary property: A summary of troubleshooting. + * + * @return the summary value. + */ + public String summary() { + return this.summary; + } + + /** + * Set the summary property: A summary of troubleshooting. + * + * @param summary the summary value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withSummary(String summary) { + this.summary = summary; + return this; + } + + /** + * Get the detail property: Details on troubleshooting results. + * + * @return the detail value. + */ + public String detail() { + return this.detail; + } + + /** + * Set the detail property: Details on troubleshooting results. + * + * @param detail the detail value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withDetail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get the recommendedActions property: List of recommended actions. + * + * @return the recommendedActions value. + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Set the recommendedActions property: List of recommended actions. + * + * @param recommendedActions the recommendedActions value to set. + * @return the TroubleshootingDetails object itself. + */ + public TroubleshootingDetails withRecommendedActions(List recommendedActions) { + this.recommendedActions = recommendedActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recommendedActions() != null) { + recommendedActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java new file mode 100644 index 0000000000000..fd1564f246071 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the resource to troubleshoot. */ +@Fluent +public final class TroubleshootingParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingParameters.class); + + /* + * 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(); + + /** + * 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java new file mode 100644 index 0000000000000..c19f6f8cf3f1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recommended actions based on discovered issues. */ +@Fluent +public final class TroubleshootingRecommendedActions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TroubleshootingRecommendedActions.class); + + /* + * ID of the recommended action. + */ + @JsonProperty(value = "actionId") + private String actionId; + + /* + * Description of recommended actions. + */ + @JsonProperty(value = "actionText") + private String actionText; + + /* + * The uri linking to a documentation for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUri") + private String actionUri; + + /* + * The information from the URI for the recommended troubleshooting + * actions. + */ + @JsonProperty(value = "actionUriText") + private String actionUriText; + + /** + * Get the actionId property: ID of the recommended action. + * + * @return the actionId value. + */ + public String actionId() { + return this.actionId; + } + + /** + * Set the actionId property: ID of the recommended action. + * + * @param actionId the actionId value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * Get the actionText property: Description of recommended actions. + * + * @return the actionText value. + */ + public String actionText() { + return this.actionText; + } + + /** + * Set the actionText property: Description of recommended actions. + * + * @param actionText the actionText value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionText(String actionText) { + this.actionText = actionText; + return this; + } + + /** + * Get the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. + * + * @return the actionUri value. + */ + public String actionUri() { + return this.actionUri; + } + + /** + * Set the actionUri property: The uri linking to a documentation for the recommended troubleshooting actions. + * + * @param actionUri the actionUri value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUri(String actionUri) { + this.actionUri = actionUri; + return this; + } + + /** + * Get the actionUriText property: The information from the URI for the recommended troubleshooting actions. + * + * @return the actionUriText value. + */ + public String actionUriText() { + return this.actionUriText; + } + + /** + * Set the actionUriText property: The information from the URI for the recommended troubleshooting actions. + * + * @param actionUriText the actionUriText value to set. + * @return the TroubleshootingRecommendedActions object itself. + */ + public TroubleshootingRecommendedActions withActionUriText(String actionUriText) { + this.actionUriText = actionUriText; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java new file mode 100644 index 0000000000000..396ee77e84a26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of TroubleshootingResult. */ +public interface TroubleshootingResult { + /** + * Gets the startTime property: The start time of the troubleshooting. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the troubleshooting. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the code property: The result code of the troubleshooting. + * + * @return the code value. + */ + String code(); + + /** + * Gets the results property: Information from troubleshooting. + * + * @return the results value. + */ + List results(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingResultInner object. + * + * @return the inner object. + */ + TroubleshootingResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java new file mode 100644 index 0000000000000..83dfcfe339cbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualNetworkGatewayConnection properties. */ +@Immutable +public final class TunnelConnectionHealth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TunnelConnectionHealth.class); + + /* + * Tunnel name. + */ + @JsonProperty(value = "tunnel", access = JsonProperty.Access.WRITE_ONLY) + private String tunnel; + + /* + * Virtual Network Gateway connection status. + */ + @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * The Ingress Bytes Transferred in this connection. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The time at which connection was established in Utc format. + */ + @JsonProperty(value = "lastConnectionEstablishedUtcTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastConnectionEstablishedUtcTime; + + /** + * Get the tunnel property: Tunnel name. + * + * @return the tunnel value. + */ + public String tunnel() { + return this.tunnel; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.connectionStatus; + } + + /** + * Get the ingressBytesTransferred property: The Ingress Bytes Transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the egressBytesTransferred property: The Egress Bytes Transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the lastConnectionEstablishedUtcTime property: The time at which connection was established in Utc format. + * + * @return the lastConnectionEstablishedUtcTime value. + */ + public String lastConnectionEstablishedUtcTime() { + return this.lastConnectionEstablishedUtcTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java new file mode 100644 index 0000000000000..0ed72167a0f3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of UnprepareNetworkPolicies for Subnet. */ +@Fluent +public final class UnprepareNetworkPoliciesRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UnprepareNetworkPoliciesRequest.class); + + /* + * The name of the service for which subnet is being unprepared for. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * Get the serviceName property: The name of the service for which subnet is being unprepared for. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the service for which subnet is being unprepared for. + * + * @param serviceName the serviceName value to set. + * @return the UnprepareNetworkPoliciesRequest object itself. + */ + public UnprepareNetworkPoliciesRequest withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java new file mode 100644 index 0000000000000..498b78749eae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the id property: Resource identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the unit property: An enum describing the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + long currentValue(); + + /** + * Gets the limit property: The limit of usage. + * + * @return the limit value. + */ + long limit(); + + /** + * Gets the name property: The name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java new file mode 100644 index 0000000000000..f6b2d101d7605 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names. */ +@Fluent +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * A string describing the resource name. + */ + @JsonProperty(value = "value") + private String value; + + /* + * A localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: A string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string describing the resource name. + * + * @param value the value value to set. + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: A localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: A localized string describing the resource name. + * + * @param localizedValue the localizedValue value to set. + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java new file mode 100644 index 0000000000000..944945399e69b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsageUnit. */ +public final class UsageUnit extends ExpandableStringEnum { + /** Static value Count for UsageUnit. */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + @JsonCreator + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** @return known UsageUnit values. */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java new file mode 100644 index 0000000000000..c53c47229d9fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + PagedIterable list(String location); + + /** + * List network usages for a subscription. + * + * @param location The location where resource usage is queried. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java new file mode 100644 index 0000000000000..42f9abbb0542b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list usages operation response. */ +@Fluent +public final class UsagesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListResult.class); + + /* + * The list network resource usages. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list network resource usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list network resource usages. + * + * @param value the value value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the UsagesListResult object itself. + */ + public UsagesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java new file mode 100644 index 0000000000000..80adb222c5add --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes a Virtual Machine. */ +@Fluent +public final class VM extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VM.class); + + /* + * Resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID. + * + * @param id the id value to set. + * @return the VM object itself. + */ + public VM withId(String id) { + this.id = id; + return this; + } + + /** {@inheritDoc} */ + @Override + public VM withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VM withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java new file mode 100644 index 0000000000000..c955fefbb3ca3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VerbosityLevel. */ +public final class VerbosityLevel extends ExpandableStringEnum { + /** Static value Normal for VerbosityLevel. */ + public static final VerbosityLevel NORMAL = fromString("Normal"); + + /** Static value Minimum for VerbosityLevel. */ + public static final VerbosityLevel MINIMUM = fromString("Minimum"); + + /** Static value Full for VerbosityLevel. */ + public static final VerbosityLevel FULL = fromString("Full"); + + /** + * Creates or finds a VerbosityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VerbosityLevel. + */ + @JsonCreator + public static VerbosityLevel fromString(String name) { + return fromString(name, VerbosityLevel.class); + } + + /** @return known VerbosityLevel values. */ + public static Collection values() { + return values(VerbosityLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java new file mode 100644 index 0000000000000..d2aa46ad8926e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters that define the IP flow to be verified. */ +@Fluent +public final class VerificationIpFlowParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VerificationIpFlowParameters.class); + + /* + * The ID of the target resource to perform next-hop on. + */ + @JsonProperty(value = "targetResourceId", required = true) + private String targetResourceId; + + /* + * The direction of the packet represented as a 5-tuple. + */ + @JsonProperty(value = "direction", required = true) + private Direction direction; + + /* + * Protocol to be verified on. + */ + @JsonProperty(value = "protocol", required = true) + private IpFlowProtocol protocol; + + /* + * The local port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "localPort", required = true) + private String localPort; + + /* + * The remote port. Acceptable values are a single integer in the range + * (0-65535). Support for * for the source port, which depends on the + * direction. + */ + @JsonProperty(value = "remotePort", required = true) + private String remotePort; + + /* + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "localIPAddress", required = true) + private String localIpAddress; + + /* + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + @JsonProperty(value = "remoteIPAddress", required = true) + private String remoteIpAddress; + + /* + * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any + * of them, then this parameter must be specified. Otherwise optional). + */ + @JsonProperty(value = "targetNicResourceId") + private String targetNicResourceId; + + /** + * Get the targetResourceId property: The ID of the target resource to perform next-hop on. + * + * @return the targetResourceId value. + */ + public String targetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: The ID of the target resource to perform next-hop on. + * + * @param targetResourceId the targetResourceId value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + return this; + } + + /** + * Get the direction property: The direction of the packet represented as a 5-tuple. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the packet represented as a 5-tuple. + * + * @param direction the direction value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: Protocol to be verified on. + * + * @return the protocol value. + */ + public IpFlowProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to be verified on. + * + * @param protocol the protocol value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withProtocol(IpFlowProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @return the localPort value. + */ + public String localPort() { + return this.localPort; + } + + /** + * Set the localPort property: The local port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @param localPort the localPort value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withLocalPort(String localPort) { + this.localPort = localPort; + return this; + } + + /** + * Get the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @return the remotePort value. + */ + public String remotePort() { + return this.remotePort; + } + + /** + * Set the remotePort property: The remote port. Acceptable values are a single integer in the range (0-65535). + * Support for * for the source port, which depends on the direction. + * + * @param remotePort the remotePort value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withRemotePort(String remotePort) { + this.remotePort = remotePort; + return this; + } + + /** + * Get the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. + * + * @return the localIpAddress value. + */ + public String localIpAddress() { + return this.localIpAddress; + } + + /** + * Set the localIpAddress property: The local IP address. Acceptable values are valid IPv4 addresses. + * + * @param localIpAddress the localIpAddress value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withLocalIpAddress(String localIpAddress) { + this.localIpAddress = localIpAddress; + return this; + } + + /** + * Get the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. + * + * @return the remoteIpAddress value. + */ + public String remoteIpAddress() { + return this.remoteIpAddress; + } + + /** + * Set the remoteIpAddress property: The remote IP address. Acceptable values are valid IPv4 addresses. + * + * @param remoteIpAddress the remoteIpAddress value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withRemoteIpAddress(String remoteIpAddress) { + this.remoteIpAddress = remoteIpAddress; + return this; + } + + /** + * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * them, then this parameter must be specified. Otherwise optional). + * + * @return the targetNicResourceId value. + */ + public String targetNicResourceId() { + return this.targetNicResourceId; + } + + /** + * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of + * them, then this parameter must be specified. Otherwise optional). + * + * @param targetNicResourceId the targetNicResourceId value to set. + * @return the VerificationIpFlowParameters object itself. + */ + public VerificationIpFlowParameters withTargetNicResourceId(String targetNicResourceId) { + this.targetNicResourceId = targetNicResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetResourceId in model VerificationIpFlowParameters")); + } + if (direction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property direction in model VerificationIpFlowParameters")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model VerificationIpFlowParameters")); + } + if (localPort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localPort in model VerificationIpFlowParameters")); + } + if (remotePort() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remotePort in model VerificationIpFlowParameters")); + } + if (localIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property localIpAddress in model VerificationIpFlowParameters")); + } + if (remoteIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property remoteIpAddress in model VerificationIpFlowParameters")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java new file mode 100644 index 0000000000000..37a83526cf2ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner; + +/** An immutable client-side representation of VerificationIpFlowResult. */ +public interface VerificationIpFlowResult { + /** + * Gets the access property: Indicates whether the traffic is allowed or denied. + * + * @return the access value. + */ + Access access(); + + /** + * Gets the ruleName property: Name of the rule. If input is not matched against any security rule, it is not + * displayed. + * + * @return the ruleName value. + */ + String ruleName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VerificationIpFlowResultInner object. + * + * @return the inner object. + */ + VerificationIpFlowResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java new file mode 100644 index 0000000000000..5e058362ed04b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance NIC properties. */ +@Immutable +public final class VirtualApplianceNicProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceNicProperties.class); + + /* + * NIC name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Public IP address. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * Private IP address. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /** + * Get the name property: NIC name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the publicIpAddress property: Public IP address. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Get the privateIpAddress property: Private IP address. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java new file mode 100644 index 0000000000000..1afd049f7f3d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; + +/** An immutable client-side representation of VirtualApplianceSite. */ +public interface VirtualApplianceSite { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the virtual appliance site. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Site type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the o365Policy property: Office 365 Policy. + * + * @return the o365Policy value. + */ + Office365PolicyProperties o365Policy(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner object. + * + * @return the inner object. + */ + VirtualApplianceSiteInner innerModel(); + + /** The entirety of the VirtualApplianceSite definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualApplianceSite definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualApplianceSite definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualApplianceSite definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkVirtualApplianceName. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withExistingNetworkVirtualAppliance( + String resourceGroupName, String networkVirtualApplianceName); + } + /** + * The stage of the VirtualApplianceSite definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, DefinitionStages.WithAddressPrefix, DefinitionStages.WithO365Policy { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualApplianceSite create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualApplianceSite create(Context context); + } + /** The stage of the VirtualApplianceSite definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual appliance site.. + * + * @param name Name of the virtual appliance site. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualApplianceSite definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address Prefix.. + * + * @param addressPrefix Address Prefix. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualApplianceSite definition allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office 365 Policy.. + * + * @param o365Policy Office 365 Policy. + * @return the next definition stage. + */ + WithCreate withO365Policy(Office365PolicyProperties o365Policy); + } + } + /** + * Begins update for the VirtualApplianceSite resource. + * + * @return the stage of resource update. + */ + VirtualApplianceSite.Update update(); + + /** The template for VirtualApplianceSite update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithAddressPrefix, UpdateStages.WithO365Policy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualApplianceSite apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualApplianceSite apply(Context context); + } + /** The VirtualApplianceSite update stages. */ + interface UpdateStages { + /** The stage of the VirtualApplianceSite update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual appliance site.. + * + * @param name Name of the virtual appliance site. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualApplianceSite update allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address Prefix.. + * + * @param addressPrefix Address Prefix. + * @return the next definition stage. + */ + Update withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualApplianceSite update allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office 365 Policy.. + * + * @param o365Policy Office 365 Policy. + * @return the next definition stage. + */ + Update withO365Policy(Office365PolicyProperties o365Policy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualApplianceSite refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualApplianceSite refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java new file mode 100644 index 0000000000000..f16237b5036db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualApplianceSites. */ +public interface VirtualApplianceSites { + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Deletes the specified site from a Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site. + */ + VirtualApplianceSite get(String resourceGroupName, String networkVirtualApplianceName, String siteName); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param siteName The name of the site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String networkVirtualApplianceName, String siteName, Context context); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + PagedIterable list(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call. + */ + PagedIterable list( + String resourceGroupName, String networkVirtualApplianceName, Context context); + + /** + * Gets the specified Virtual Appliance Site. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Appliance Site 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..f98f45803698b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Network Virtual Appliance Sku Properties. */ +@Fluent +public final class VirtualApplianceSkuProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualApplianceSkuProperties.class); + + /* + * Virtual Appliance Vendor. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * Virtual Appliance Scale Unit. + */ + @JsonProperty(value = "bundledScaleUnit") + private String bundledScaleUnit; + + /* + * Virtual Appliance Version. + */ + @JsonProperty(value = "marketPlaceVersion") + private String marketPlaceVersion; + + /** + * Get the vendor property: Virtual Appliance Vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor property: Virtual Appliance Vendor. + * + * @param vendor the vendor value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the bundledScaleUnit property: Virtual Appliance Scale Unit. + * + * @return the bundledScaleUnit value. + */ + public String bundledScaleUnit() { + return this.bundledScaleUnit; + } + + /** + * Set the bundledScaleUnit property: Virtual Appliance Scale Unit. + * + * @param bundledScaleUnit the bundledScaleUnit value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withBundledScaleUnit(String bundledScaleUnit) { + this.bundledScaleUnit = bundledScaleUnit; + return this; + } + + /** + * Get the marketPlaceVersion property: Virtual Appliance Version. + * + * @return the marketPlaceVersion value. + */ + public String marketPlaceVersion() { + return this.marketPlaceVersion; + } + + /** + * Set the marketPlaceVersion property: Virtual Appliance Version. + * + * @param marketPlaceVersion the marketPlaceVersion value to set. + * @return the VirtualApplianceSkuProperties object itself. + */ + public VirtualApplianceSkuProperties withMarketPlaceVersion(String marketPlaceVersion) { + this.marketPlaceVersion = marketPlaceVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java new file mode 100644 index 0000000000000..8b621b8d48e4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualApplianceSkus. */ +public interface VirtualApplianceSkus { + /** + * List all SKUs available for a virtual appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + PagedIterable list(); + + /** + * List all SKUs available for a virtual appliance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call. + */ + PagedIterable list(Context context); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus. + */ + NetworkVirtualApplianceSku get(String skuName); + + /** + * Retrieves a single available sku for network virtual appliance. + * + * @param skuName Name of the Sku. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available NetworkVirtualApplianceSkus along with {@link Response}. + */ + Response getWithResponse(String skuName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java new file mode 100644 index 0000000000000..90bc6863f2fa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.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 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner object. + * + * @return the inner object. + */ + VirtualHubInner innerModel(); + + /** The entirety of the VirtualHub definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualHub definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualHub definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualHub definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualHub definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualHub definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithVirtualWan, + DefinitionStages.WithVpnGateway, + DefinitionStages.WithP2SVpnGateway, + DefinitionStages.WithExpressRouteGateway, + DefinitionStages.WithAzureFirewall, + DefinitionStages.WithSecurityPartnerProvider, + DefinitionStages.WithAddressPrefix, + DefinitionStages.WithRouteTable, + DefinitionStages.WithSecurityProviderName, + DefinitionStages.WithVirtualHubRouteTableV2S, + DefinitionStages.WithSku, + DefinitionStages.WithVirtualRouterAsn, + DefinitionStages.WithVirtualRouterIps, + DefinitionStages.WithAllowBranchToBranchTraffic, + DefinitionStages.WithPreferredRoutingGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualHub create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualHub create(Context context); + } + /** The stage of the VirtualHub definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualHub definition allowing to specify virtualWan. */ + interface WithVirtualWan { + /** + * Specifies the virtualWan property: The VirtualWAN to which the VirtualHub belongs.. + * + * @param virtualWan The VirtualWAN to which the VirtualHub belongs. + * @return the next definition stage. + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + /** The stage of the VirtualHub definition allowing to specify vpnGateway. */ + interface WithVpnGateway { + /** + * Specifies the vpnGateway property: The VpnGateway associated with this VirtualHub.. + * + * @param vpnGateway The VpnGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withVpnGateway(SubResource vpnGateway); + } + /** The stage of the VirtualHub definition allowing to specify p2SVpnGateway. */ + interface WithP2SVpnGateway { + /** + * Specifies the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub.. + * + * @param p2SVpnGateway The P2SVpnGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withP2SVpnGateway(SubResource p2SVpnGateway); + } + /** The stage of the VirtualHub definition allowing to specify expressRouteGateway. */ + interface WithExpressRouteGateway { + /** + * Specifies the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub.. + * + * @param expressRouteGateway The expressRouteGateway associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withExpressRouteGateway(SubResource expressRouteGateway); + } + /** The stage of the VirtualHub definition allowing to specify azureFirewall. */ + interface WithAzureFirewall { + /** + * Specifies the azureFirewall property: The azureFirewall associated with this VirtualHub.. + * + * @param azureFirewall The azureFirewall associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withAzureFirewall(SubResource azureFirewall); + } + /** The stage of the VirtualHub definition allowing to specify securityPartnerProvider. */ + interface WithSecurityPartnerProvider { + /** + * Specifies the securityPartnerProvider property: The securityPartnerProvider associated with this + * VirtualHub.. + * + * @param securityPartnerProvider The securityPartnerProvider associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withSecurityPartnerProvider(SubResource securityPartnerProvider); + } + /** The stage of the VirtualHub definition allowing to specify addressPrefix. */ + interface WithAddressPrefix { + /** + * Specifies the addressPrefix property: Address-prefix for this VirtualHub.. + * + * @param addressPrefix Address-prefix for this VirtualHub. + * @return the next definition stage. + */ + WithCreate withAddressPrefix(String addressPrefix); + } + /** The stage of the VirtualHub definition allowing to specify routeTable. */ + interface WithRouteTable { + /** + * Specifies the routeTable property: The routeTable associated with this virtual hub.. + * + * @param routeTable The routeTable associated with this virtual hub. + * @return the next definition stage. + */ + WithCreate withRouteTable(VirtualHubRouteTable routeTable); + } + /** The stage of the VirtualHub definition allowing to specify securityProviderName. */ + interface WithSecurityProviderName { + /** + * Specifies the securityProviderName property: The Security Provider name.. + * + * @param securityProviderName The Security Provider name. + * @return the next definition stage. + */ + WithCreate withSecurityProviderName(String securityProviderName); + } + /** The stage of the VirtualHub definition allowing to specify virtualHubRouteTableV2S. */ + interface WithVirtualHubRouteTableV2S { + /** + * Specifies the virtualHubRouteTableV2S property: List of all virtual hub route table v2s associated with + * this VirtualHub.. + * + * @param virtualHubRouteTableV2S List of all virtual hub route table v2s associated with this VirtualHub. + * @return the next definition stage. + */ + WithCreate withVirtualHubRouteTableV2S(List virtualHubRouteTableV2S); + } + /** The stage of the VirtualHub definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of this VirtualHub.. + * + * @param sku The sku of this VirtualHub. + * @return the next definition stage. + */ + WithCreate withSku(String sku); + } + /** The stage of the VirtualHub definition allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + WithCreate withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualHub definition allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + WithCreate withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualHub definition allowing to specify allowBranchToBranchTraffic. */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub.. + * + * @param allowBranchToBranchTraffic Flag to control transit for VirtualRouter hub. + * @return the next definition stage. + */ + WithCreate withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + /** The stage of the VirtualHub definition allowing to specify preferredRoutingGateway. */ + interface WithPreferredRoutingGateway { + /** + * Specifies the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @param preferredRoutingGateway The preferred gateway to route on-prem traffic. + * @return the next definition stage. + */ + WithCreate withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway); + } + } + /** + * Begins update for the VirtualHub resource. + * + * @return the stage of resource update. + */ + VirtualHub.Update update(); + + /** The template for VirtualHub update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualHub apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualHub apply(Context context); + } + /** The VirtualHub update stages. */ + interface UpdateStages { + /** The stage of the VirtualHub update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualHub refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualHub refresh(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java new file mode 100644 index 0000000000000..7175cce06b1ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualHubBgpConnections. */ +public interface VirtualHubBgpConnections { + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource. + */ + BgpConnection get(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String connectionName); + + /** + * Deletes a VirtualHubBgpConnection. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String connectionName, Context context); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubBgpConnections. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection has learned. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listLearnedRoutes(String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName); + + /** + * Retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param hubName The name of the virtual hub. + * @param connectionName The name of the virtual hub bgp connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual router peer routes. + */ + PeerRouteList listAdvertisedRoutes( + String resourceGroupName, String hubName, String connectionName, Context context); + + /** + * Retrieves the details of a Virtual Hub Bgp Connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtual Appliance Site resource 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..fcf1095a3efdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Hub identifier. */ +@Fluent +public final class VirtualHubId { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubId.class); + + /* + * The resource URI for the Virtual Hub where the ExpressRoute gateway is + * or will be deployed. The Virtual Hub resource and the ExpressRoute + * gateway resource reside in the same subscription. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. + * The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. + * + * @param id the id value to set. + * @return the VirtualHubId object itself. + */ + public VirtualHubId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java new file mode 100644 index 0000000000000..365f77d004165 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualHubIpConfigurations. */ +public interface VirtualHubIpConfigurations { + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations. + */ + HubIpConfiguration get(String resourceGroupName, String virtualHubName, String ipConfigName); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String ipConfigName, Context context); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String ipConfigName); + + /** + * Deletes a VirtualHubIpConfiguration. + * + * @param resourceGroupName The resource group name of the VirtualHubBgpConnection. + * @param virtualHubName The name of the VirtualHub. + * @param ipConfigName The name of the ipconfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String ipConfigName, Context context); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubIpConfigurations. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a Virtual Hub Ip configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return ipConfigurations 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..8049022fe97f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHub route. */ +@Fluent +public final class VirtualHubRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRoute.class); + + /* + * List of all addressPrefixes. + */ + @JsonProperty(value = "addressPrefixes") + private List addressPrefixes; + + /* + * NextHop ip address. + */ + @JsonProperty(value = "nextHopIpAddress") + private String nextHopIpAddress; + + /** + * Get the addressPrefixes property: List of all addressPrefixes. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: List of all addressPrefixes. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the nextHopIpAddress property: NextHop ip address. + * + * @return the nextHopIpAddress value. + */ + public String nextHopIpAddress() { + return this.nextHopIpAddress; + } + + /** + * Set the nextHopIpAddress property: NextHop ip address. + * + * @param nextHopIpAddress the nextHopIpAddress value to set. + * @return the VirtualHubRoute object itself. + */ + public VirtualHubRoute withNextHopIpAddress(String nextHopIpAddress) { + this.nextHopIpAddress = nextHopIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java new file mode 100644 index 0000000000000..f7029f25ceb54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHub route table. */ +@Fluent +public final class VirtualHubRouteTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteTable.class); + + /* + * List of all routes. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: List of all routes. + * + * @param routes the routes value to set. + * @return the VirtualHubRouteTable object itself. + */ + public VirtualHubRouteTable withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java new file mode 100644 index 0000000000000..368efa892c8f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import java.util.List; + +/** An immutable client-side representation of VirtualHubRouteTableV2. */ +public interface VirtualHubRouteTableV2 { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the routes property: List of all routes. + * + * @return the routes value. + */ + List routes(); + + /** + * Gets the attachedConnections property: List of all connections attached to this route table v2. + * + * @return the attachedConnections value. + */ + List attachedConnections(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual hub route table v2 resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner object. + * + * @return the inner object. + */ + VirtualHubRouteTableV2Inner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java new file mode 100644 index 0000000000000..7dee6e47ca851 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; + +/** Resource collection API of VirtualHubRouteTableV2S. */ +public interface VirtualHubRouteTableV2S { + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 get(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Retrieves the details of a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters); + + /** + * Creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param virtualHubRouteTableV2Parameters Parameters supplied to create or update VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubRouteTableV2 Resource. + */ + VirtualHubRouteTableV2 createOrUpdate( + String resourceGroupName, + String virtualHubName, + String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, + Context context); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String routeTableName); + + /** + * Deletes a VirtualHubRouteTableV2. + * + * @param resourceGroupName The resource group name of the VirtualHubRouteTableV2. + * @param virtualHubName The name of the VirtualHub. + * @param routeTableName The name of the VirtualHubRouteTableV2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all VirtualHubRouteTableV2s. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java new file mode 100644 index 0000000000000..57e4ff2d53e31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualHubRouteTableV2 route. */ +@Fluent +public final class VirtualHubRouteV2 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualHubRouteV2.class); + + /* + * The type of destinations. + */ + @JsonProperty(value = "destinationType") + private String destinationType; + + /* + * List of all destinations. + */ + @JsonProperty(value = "destinations") + private List destinations; + + /* + * The type of next hops. + */ + @JsonProperty(value = "nextHopType") + private String nextHopType; + + /* + * NextHops ip address. + */ + @JsonProperty(value = "nextHops") + private List nextHops; + + /** + * Get the destinationType property: The type of destinations. + * + * @return the destinationType value. + */ + public String destinationType() { + return this.destinationType; + } + + /** + * Set the destinationType property: The type of destinations. + * + * @param destinationType the destinationType value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withDestinationType(String destinationType) { + this.destinationType = destinationType; + return this; + } + + /** + * Get the destinations property: List of all destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of all destinations. + * + * @param destinations the destinations value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the nextHopType property: The type of next hops. + * + * @return the nextHopType value. + */ + public String nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: The type of next hops. + * + * @param nextHopType the nextHopType value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withNextHopType(String nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHops property: NextHops ip address. + * + * @return the nextHops value. + */ + public List nextHops() { + return this.nextHops; + } + + /** + * Set the nextHops property: NextHops ip address. + * + * @param nextHops the nextHops value to set. + * @return the VirtualHubRouteV2 object itself. + */ + public VirtualHubRouteV2 withNextHops(List nextHops) { + this.nextHops = nextHops; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java new file mode 100644 index 0000000000000..50b807a2bcaf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualHubs. */ +public interface VirtualHubs { + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource. + */ + VirtualHub getByResourceGroup(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualHubName, Context context); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualHubName); + + /** + * Deletes a VirtualHub. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualHubName, Context context); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualHubs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualHubs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable list(); + + /** + * Lists all the VirtualHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs. + */ + PagedIterable list(Context context); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes( + String resourceGroupName, String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName); + + /** + * Gets the effective routes configured for the Virtual Hub resource or the specified resource . + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param effectiveRoutesParameters Parameters supplied to get the effective routes for a specific resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getEffectiveVirtualHubRoutes( + String resourceGroupName, + String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * Retrieves the details of a VirtualHub. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHub Resource 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..24e23d8893f1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.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.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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner object. + * + * @return the inner object. + */ + VirtualNetworkInner innerModel(); + + /** The entirety of the VirtualNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetwork definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAddressSpace, + DefinitionStages.WithDhcpOptions, + DefinitionStages.WithFlowTimeoutInMinutes, + DefinitionStages.WithSubnets, + DefinitionStages.WithVirtualNetworkPeerings, + DefinitionStages.WithEnableDdosProtection, + DefinitionStages.WithEnableVmProtection, + DefinitionStages.WithDdosProtectionPlan, + DefinitionStages.WithBgpCommunities, + DefinitionStages.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); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java new file mode 100644 index 0000000000000..a46363a56cf3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. */ +@Fluent +public final class VirtualNetworkBgpCommunities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkBgpCommunities.class); + + /* + * The BGP community associated with the virtual network. + */ + @JsonProperty(value = "virtualNetworkCommunity", required = true) + private String virtualNetworkCommunity; + + /* + * The BGP community associated with the region of the virtual network. + */ + @JsonProperty(value = "regionalCommunity", access = JsonProperty.Access.WRITE_ONLY) + private String regionalCommunity; + + /** + * Get the virtualNetworkCommunity property: The BGP community associated with the virtual network. + * + * @return the virtualNetworkCommunity value. + */ + public String virtualNetworkCommunity() { + return this.virtualNetworkCommunity; + } + + /** + * Set the virtualNetworkCommunity property: The BGP community associated with the virtual network. + * + * @param virtualNetworkCommunity the virtualNetworkCommunity value to set. + * @return the VirtualNetworkBgpCommunities object itself. + */ + public VirtualNetworkBgpCommunities withVirtualNetworkCommunity(String virtualNetworkCommunity) { + this.virtualNetworkCommunity = virtualNetworkCommunity; + return this; + } + + /** + * Get the regionalCommunity property: The BGP community associated with the region of the virtual network. + * + * @return the regionalCommunity value. + */ + public String regionalCommunity() { + return this.regionalCommunity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkCommunity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkCommunity in model VirtualNetworkBgpCommunities")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java new file mode 100644 index 0000000000000..bad252dfab984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A reference to VirtualNetworkGateway or LocalNetworkGateway resource. */ +@Fluent +public final class VirtualNetworkConnectionGatewayReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConnectionGatewayReference.class); + + /* + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + * + * @param id the id value to set. + * @return the VirtualNetworkConnectionGatewayReference object itself. + */ + public VirtualNetworkConnectionGatewayReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property id in model VirtualNetworkConnectionGatewayReference")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..f3689d4e53bad --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkEncryption.class); + + /* + * 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; + + /** + * 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..e5384ac8e412c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkEncryptionEnforcement. */ +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 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); + } + + /** @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..e000a9a423a2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java @@ -0,0 +1,925 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner object. + * + * @return the inner object. + */ + VirtualNetworkGatewayInner innerModel(); + + /** The entirety of the VirtualNetworkGateway definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkGateway definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGateway definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkGateway definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetworkGateway definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithIpConfigurations, + DefinitionStages.WithGatewayType, + DefinitionStages.WithVpnType, + DefinitionStages.WithVpnGatewayGeneration, + DefinitionStages.WithEnableBgp, + DefinitionStages.WithEnablePrivateIpAddress, + DefinitionStages.WithActive, + DefinitionStages.WithDisableIpSecReplayProtection, + DefinitionStages.WithGatewayDefaultSite, + DefinitionStages.WithSku, + DefinitionStages.WithVpnClientConfiguration, + DefinitionStages.WithBgpSettings, + DefinitionStages.WithCustomRoutes, + DefinitionStages.WithEnableDnsForwarding, + DefinitionStages.WithVNetExtendedLocationResourceId, + DefinitionStages.WithNatRules, + DefinitionStages.WithEnableBgpRouteTranslationForNat { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGateway create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGateway create(Context context); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of type local virtual network gateway.. + * + * @param extendedLocation The extended location of type local virtual network gateway. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify ipConfigurations. */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: IP configurations for virtual network gateway.. + * + * @param ipConfigurations IP configurations for virtual network gateway. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify gatewayType. */ + interface WithGatewayType { + /** + * Specifies the gatewayType property: The type of this virtual network gateway.. + * + * @param gatewayType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withGatewayType(VirtualNetworkGatewayType gatewayType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnType. */ + interface WithVpnType { + /** + * Specifies the vpnType property: The type of this virtual network gateway.. + * + * @param vpnType The type of this virtual network gateway. + * @return the next definition stage. + */ + WithCreate withVpnType(VpnType vpnType); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vpnGatewayGeneration. */ + interface WithVpnGatewayGeneration { + /** + * Specifies the vpnGatewayGeneration property: The generation for this VirtualNetworkGateway. Must be None + * if gatewayType is not VPN.. + * + * @param vpnGatewayGeneration The generation for this VirtualNetworkGateway. Must be None if gatewayType is + * not VPN. + * @return the next definition stage. + */ + WithCreate withVpnGatewayGeneration(VpnGatewayGeneration vpnGatewayGeneration); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableBgp. */ + interface WithEnableBgp { + /** + * Specifies the enableBgp property: Whether BGP is enabled for this virtual network gateway or not.. + * + * @param enableBgp Whether BGP is enabled for this virtual network gateway or not. + * @return the next definition stage. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enablePrivateIpAddress. */ + interface WithEnablePrivateIpAddress { + /** + * Specifies the enablePrivateIpAddress property: Whether private IP needs to be enabled on this gateway for + * connections or not.. + * + * @param enablePrivateIpAddress Whether private IP needs to be enabled on this gateway for connections or + * not. + * @return the next definition stage. + */ + WithCreate withEnablePrivateIpAddress(Boolean enablePrivateIpAddress); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify active. */ + interface WithActive { + /** + * Specifies the active property: ActiveActive flag.. + * + * @param active ActiveActive flag. + * @return the next definition stage. + */ + WithCreate withActive(Boolean active); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify 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 bgpSettings. */ + interface WithBgpSettings { + /** + * Specifies the bgpSettings property: Virtual network gateway's BGP speaker settings.. + * + * @param bgpSettings Virtual network gateway's BGP speaker settings. + * @return the next definition stage. + */ + WithCreate withBgpSettings(BgpSettings bgpSettings); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify customRoutes. */ + interface WithCustomRoutes { + /** + * Specifies the customRoutes property: The reference to the address space resource which represents the + * custom routes address space specified by the customer for virtual network gateway and VpnClient.. + * + * @param customRoutes The reference to the address space resource which represents the custom routes + * address space specified by the customer for virtual network gateway and VpnClient. + * @return the next definition stage. + */ + WithCreate withCustomRoutes(AddressSpace customRoutes); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableDnsForwarding. */ + interface WithEnableDnsForwarding { + /** + * Specifies the enableDnsForwarding property: Whether dns forwarding is enabled or not.. + * + * @param enableDnsForwarding Whether dns forwarding is enabled or not. + * @return the next definition stage. + */ + WithCreate withEnableDnsForwarding(Boolean enableDnsForwarding); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify vNetExtendedLocationResourceId. */ + interface WithVNetExtendedLocationResourceId { + /** + * Specifies the vNetExtendedLocationResourceId property: Customer vnet resource id. VirtualNetworkGateway + * of type local gateway is associated with the customer vnet.. + * + * @param vNetExtendedLocationResourceId Customer vnet resource id. VirtualNetworkGateway of type local + * gateway is associated with the customer vnet. + * @return the next definition stage. + */ + WithCreate withVNetExtendedLocationResourceId(String vNetExtendedLocationResourceId); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify natRules. */ + interface WithNatRules { + /** + * Specifies the natRules property: NatRules for virtual network gateway.. + * + * @param natRules NatRules for virtual network gateway. + * @return the next definition stage. + */ + WithCreate withNatRules(List natRules); + } + /** The stage of the VirtualNetworkGateway definition allowing to specify enableBgpRouteTranslationForNat. */ + interface WithEnableBgpRouteTranslationForNat { + /** + * Specifies the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag.. + * + * @param enableBgpRouteTranslationForNat EnableBgpRouteTranslationForNat flag. + * @return the next definition stage. + */ + WithCreate withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat); + } + } + /** + * Begins update for the VirtualNetworkGateway resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGateway.Update update(); + + /** The template for VirtualNetworkGateway update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGateway apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGateway apply(Context context); + } + /** The VirtualNetworkGateway update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGateway update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGateway refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGateway refresh(Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetVpnClientSharedKey(); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetVpnClientSharedKey(Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generatevpnclientpackage(VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generatevpnclientpackage(VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generateVpnProfile(VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generateVpnProfile(VpnClientParameters parameters, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + String supportedVpnDevices(); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices along with {@link Response}. + */ + Response supportedVpnDevicesWithResponse(Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters(VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + VpnClientIPsecParametersInner vpnclientIpsecParams, Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth(Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectVirtualNetworkGatewayVpnConnections(P2SVpnConnectionRequest request, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java new file mode 100644 index 0000000000000..e85d92f2d46ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java @@ -0,0 +1,697 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkGatewayConnection. */ +public interface VirtualNetworkGatewayConnection { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner + * object. + * + * @return the inner object. + */ + VirtualNetworkGatewayConnectionInner innerModel(); + + /** The entirety of the VirtualNetworkGatewayConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithVirtualNetworkGateway1, + DefinitionStages.WithConnectionType, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkGatewayConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGatewayConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithVirtualNetworkGateway1 withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify virtualNetworkGateway1. */ + interface WithVirtualNetworkGateway1 { + /** + * Specifies the virtualNetworkGateway1 property: The reference to virtual network gateway resource.. + * + * @param virtualNetworkGateway1 The reference to virtual network gateway resource. + * @return the next definition stage. + */ + WithConnectionType withVirtualNetworkGateway1(VirtualNetworkGatewayInner virtualNetworkGateway1); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionType. */ + interface WithConnectionType { + /** + * Specifies the connectionType property: Gateway connection type.. + * + * @param connectionType Gateway connection type. + * @return the next definition stage. + */ + WithCreate withConnectionType(VirtualNetworkGatewayConnectionType connectionType); + } + /** + * The stage of the VirtualNetworkGatewayConnection definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithAuthorizationKey, + DefinitionStages.WithVirtualNetworkGateway2, + DefinitionStages.WithLocalNetworkGateway2, + DefinitionStages.WithIngressNatRules, + DefinitionStages.WithEgressNatRules, + DefinitionStages.WithConnectionProtocol, + DefinitionStages.WithRoutingWeight, + DefinitionStages.WithDpdTimeoutSeconds, + DefinitionStages.WithConnectionMode, + DefinitionStages.WithSharedKey, + DefinitionStages.WithPeer, + DefinitionStages.WithEnableBgp, + DefinitionStages.WithUseLocalAzureIpAddress, + DefinitionStages.WithUsePolicyBasedTrafficSelectors, + DefinitionStages.WithIpsecPolicies, + DefinitionStages.WithTrafficSelectorPolicies, + DefinitionStages.WithExpressRouteGatewayBypass { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGatewayConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGatewayConnection create(Context context); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: The authorizationKey.. + * + * @param authorizationKey The authorizationKey. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify virtualNetworkGateway2. */ + interface WithVirtualNetworkGateway2 { + /** + * Specifies the virtualNetworkGateway2 property: The reference to virtual network gateway resource.. + * + * @param virtualNetworkGateway2 The reference to virtual network gateway resource. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkGateway2(VirtualNetworkGatewayInner virtualNetworkGateway2); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify localNetworkGateway2. */ + interface WithLocalNetworkGateway2 { + /** + * Specifies the localNetworkGateway2 property: The reference to local network gateway resource.. + * + * @param localNetworkGateway2 The reference to local network gateway resource. + * @return the next definition stage. + */ + WithCreate withLocalNetworkGateway2(LocalNetworkGatewayInner localNetworkGateway2); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify ingressNatRules. */ + interface WithIngressNatRules { + /** + * Specifies the ingressNatRules property: List of ingress NatRules.. + * + * @param ingressNatRules List of ingress NatRules. + * @return the next definition stage. + */ + WithCreate withIngressNatRules(List ingressNatRules); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify egressNatRules. */ + interface WithEgressNatRules { + /** + * Specifies the egressNatRules property: List of egress NatRules.. + * + * @param egressNatRules List of egress NatRules. + * @return the next definition stage. + */ + WithCreate withEgressNatRules(List egressNatRules); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionProtocol. */ + interface WithConnectionProtocol { + /** + * Specifies the connectionProtocol property: Connection protocol used for this connection.. + * + * @param connectionProtocol Connection protocol used for this connection. + * @return the next definition stage. + */ + WithCreate withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol connectionProtocol); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify routingWeight. */ + interface WithRoutingWeight { + /** + * Specifies the routingWeight property: The routing weight.. + * + * @param routingWeight The routing weight. + * @return the next definition stage. + */ + WithCreate withRoutingWeight(Integer routingWeight); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify dpdTimeoutSeconds. */ + interface WithDpdTimeoutSeconds { + /** + * Specifies the dpdTimeoutSeconds property: The dead peer detection timeout of this connection in seconds.. + * + * @param dpdTimeoutSeconds The dead peer detection timeout of this connection in seconds. + * @return the next definition stage. + */ + WithCreate withDpdTimeoutSeconds(Integer dpdTimeoutSeconds); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify connectionMode. */ + interface WithConnectionMode { + /** + * Specifies the connectionMode property: The connection mode for this connection.. + * + * @param connectionMode The connection mode for this connection. + * @return the next definition stage. + */ + WithCreate withConnectionMode(VirtualNetworkGatewayConnectionMode connectionMode); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify sharedKey. */ + interface WithSharedKey { + /** + * Specifies the sharedKey property: The IPSec shared key.. + * + * @param sharedKey The IPSec shared key. + * @return the next definition stage. + */ + WithCreate withSharedKey(String sharedKey); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify peer. */ + interface WithPeer { + /** + * Specifies the peer property: The reference to peerings resource.. + * + * @param peer The reference to peerings resource. + * @return the next definition stage. + */ + WithCreate withPeer(SubResource peer); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify enableBgp. */ + interface WithEnableBgp { + /** + * Specifies the enableBgp property: EnableBgp flag.. + * + * @param enableBgp EnableBgp flag. + * @return the next definition stage. + */ + WithCreate withEnableBgp(Boolean enableBgp); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify useLocalAzureIpAddress. */ + interface WithUseLocalAzureIpAddress { + /** + * Specifies the useLocalAzureIpAddress property: Use private local Azure IP for the connection.. + * + * @param useLocalAzureIpAddress Use private local Azure IP for the connection. + * @return the next definition stage. + */ + WithCreate withUseLocalAzureIpAddress(Boolean useLocalAzureIpAddress); + } + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify + * usePolicyBasedTrafficSelectors. + */ + interface WithUsePolicyBasedTrafficSelectors { + /** + * Specifies the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors.. + * + * @param usePolicyBasedTrafficSelectors Enable policy-based traffic selectors. + * @return the next definition stage. + */ + WithCreate withUsePolicyBasedTrafficSelectors(Boolean usePolicyBasedTrafficSelectors); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify ipsecPolicies. */ + interface WithIpsecPolicies { + /** + * Specifies the ipsecPolicies property: The IPSec Policies to be considered by this connection.. + * + * @param ipsecPolicies The IPSec Policies to be considered by this connection. + * @return the next definition stage. + */ + WithCreate withIpsecPolicies(List ipsecPolicies); + } + /** The stage of the VirtualNetworkGatewayConnection definition allowing to specify trafficSelectorPolicies. */ + interface WithTrafficSelectorPolicies { + /** + * Specifies the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this + * connection.. + * + * @param trafficSelectorPolicies The Traffic Selector Policies to be considered by this connection. + * @return the next definition stage. + */ + WithCreate withTrafficSelectorPolicies(List trafficSelectorPolicies); + } + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify expressRouteGatewayBypass. + */ + interface WithExpressRouteGatewayBypass { + /** + * Specifies the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding.. + * + * @param expressRouteGatewayBypass Bypass ExpressRoute Gateway for data forwarding. + * @return the next definition stage. + */ + WithCreate withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass); + } + } + /** + * Begins update for the VirtualNetworkGatewayConnection resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGatewayConnection.Update update(); + + /** The template for VirtualNetworkGatewayConnection update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGatewayConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGatewayConnection apply(Context context); + } + /** The VirtualNetworkGatewayConnection update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGatewayConnection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGatewayConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGatewayConnection refresh(Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnPacketCaptureStopParameters parameters, Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection(); + + /** + * Resets the virtual network gateway connection specified. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java new file mode 100644 index 0000000000000..2c6cc70641268 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkGatewayConnectionListEntity. */ +public interface VirtualNetworkGatewayConnectionListEntity { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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 inner + * com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner object. + * + * @return the inner object. + */ + VirtualNetworkGatewayConnectionListEntityInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java new file mode 100644 index 0000000000000..38baa6a869fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGatewayConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayConnectionListResult.class); + + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a + * resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayConnectionListResult object itself. + */ + public VirtualNetworkGatewayConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java new file mode 100644 index 0000000000000..c02c0b46c8fae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionMode. */ +public final class VirtualNetworkGatewayConnectionMode + extends ExpandableStringEnum { + /** Static value Default for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode DEFAULT = fromString("Default"); + + /** Static value ResponderOnly for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode RESPONDER_ONLY = fromString("ResponderOnly"); + + /** Static value InitiatorOnly for VirtualNetworkGatewayConnectionMode. */ + public static final VirtualNetworkGatewayConnectionMode INITIATOR_ONLY = fromString("InitiatorOnly"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionMode. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionMode fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionMode.class); + } + + /** @return known VirtualNetworkGatewayConnectionMode values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..920caaff387dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionPropertiesFormat.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.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 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 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..1073adcc854a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionProtocol. */ +public final class VirtualNetworkGatewayConnectionProtocol + extends ExpandableStringEnum { + /** Static value IKEv2 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV2 = fromString("IKEv2"); + + /** Static value IKEv1 for VirtualNetworkGatewayConnectionProtocol. */ + public static final VirtualNetworkGatewayConnectionProtocol IKEV1 = fromString("IKEv1"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionProtocol. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionProtocol fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionProtocol.class); + } + + /** @return known VirtualNetworkGatewayConnectionProtocol values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java new file mode 100644 index 0000000000000..072a609d3d9ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionStatus. */ +public final class VirtualNetworkGatewayConnectionStatus + extends ExpandableStringEnum { + /** Static value Unknown for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VirtualNetworkGatewayConnectionStatus. */ + public static final VirtualNetworkGatewayConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionStatus. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** @return known VirtualNetworkGatewayConnectionStatus values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java new file mode 100644 index 0000000000000..b53167f80b070 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayConnectionType. */ +public final class VirtualNetworkGatewayConnectionType + extends ExpandableStringEnum { + /** Static value IPsec for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType IPSEC = fromString("IPsec"); + + /** Static value Vnet2Vnet for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VNET2VNET = fromString("Vnet2Vnet"); + + /** Static value ExpressRoute for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value VPNClient for VirtualNetworkGatewayConnectionType. */ + public static final VirtualNetworkGatewayConnectionType VPNCLIENT = fromString("VPNClient"); + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionType. + */ + @JsonCreator + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** @return known VirtualNetworkGatewayConnectionType values. */ + public static Collection values() { + return values(VirtualNetworkGatewayConnectionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java new file mode 100644 index 0000000000000..547888f79c42d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** Resource collection API of VirtualNetworkGatewayConnections. */ +public interface VirtualNetworkGatewayConnections { + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group. + */ + VirtualNetworkGatewayConnection getByResourceGroup( + String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Deletes the specified virtual network Gateway connection. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey setSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters); + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key + * for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation + * throughNetwork resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey setSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionSharedKeyInner parameters, + Context context); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call. + */ + ConnectionSharedKey getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual + * network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetConnectionSharedKey API service call along with {@link Response}. + */ + Response getSharedKeyWithResponse( + String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections + * created. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters); + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared + * key for passed virtual network gateway connection in the specified resource group through Network resource + * provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared key operation + * through network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the virtual network connection reset shared key. + */ + ConnectionResetSharedKey resetSharedKey( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Starts packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Lists IKE Security Associations for the virtual network gateway connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName); + + /** + * Resets the virtual network gateway connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection(String resourceGroupName, String virtualNetworkGatewayConnectionName, Context context); + + /** + * Gets the specified virtual network gateway connection by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway connection by resource group 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..91024b4a88bce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayIpConfigurationPropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP configuration for virtual network gateway. */ +@Fluent +public final class VirtualNetworkGatewayIpConfiguration extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayIpConfiguration.class); + + /* + * 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; + + /** + * 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..a93ee9c313b02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the VirtualNetworkGatewayListConnections API service call. */ +@Fluent +public final class VirtualNetworkGatewayListConnectionsResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListConnectionsResult.class); + + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a + * resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayListConnectionsResult object itself. + */ + public VirtualNetworkGatewayListConnectionsResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java new file mode 100644 index 0000000000000..ea61528b66ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworkGateways API service call. */ +@Fluent +public final class VirtualNetworkGatewayListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewayListResult.class); + + /* + * A list of VirtualNetworkGateway resources that exists in a resource + * group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkGateway resources that exists in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkGateway resources that exists in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkGatewayListResult object itself. + */ + public VirtualNetworkGatewayListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java new file mode 100644 index 0000000000000..45a794e764679 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import java.util.List; + +/** An immutable client-side representation of VirtualNetworkGatewayNatRule. */ +public interface VirtualNetworkGatewayNatRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + VpnNatRuleType typePropertiesType(); + + /** + * Gets the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + VpnNatRuleMode mode(); + + /** + * Gets the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + List internalMappings(); + + /** + * Gets the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + List externalMappings(); + + /** + * Gets the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + String ipConfigurationId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner + * object. + * + * @return the inner object. + */ + VirtualNetworkGatewayNatRuleInner innerModel(); + + /** The entirety of the VirtualNetworkGatewayNatRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualNetworkGatewayNatRule definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkGatewayNatRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkGatewayName. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetworkGateway(String resourceGroupName, String virtualNetworkGatewayName); + } + /** + * The stage of the VirtualNetworkGatewayNatRule definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithMode, + DefinitionStages.WithInternalMappings, + DefinitionStages.WithExternalMappings, + DefinitionStages.WithIpConfigurationId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkGatewayNatRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkGatewayNatRule create(Context context); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + WithCreate withMode(VpnNatRuleMode mode); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + WithCreate withInternalMappings(List internalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + WithCreate withExternalMappings(List externalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule definition allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + WithCreate withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Begins update for the VirtualNetworkGatewayNatRule resource. + * + * @return the stage of resource update. + */ + VirtualNetworkGatewayNatRule.Update update(); + + /** The template for VirtualNetworkGatewayNatRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithMode, + UpdateStages.WithInternalMappings, + UpdateStages.WithExternalMappings, + UpdateStages.WithIpConfigurationId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkGatewayNatRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkGatewayNatRule apply(Context context); + } + /** The VirtualNetworkGatewayNatRule update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + Update withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + Update withMode(VpnNatRuleMode mode); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + Update withInternalMappings(List internalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + Update withExternalMappings(List externalMappings); + } + /** The stage of the VirtualNetworkGatewayNatRule update allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + Update withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkGatewayNatRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkGatewayNatRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java new file mode 100644 index 0000000000000..b09032beb8de4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkGatewayNatRules. */ +public interface VirtualNetworkGatewayNatRules { + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource. + */ + VirtualNetworkGatewayNatRule get(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName); + + /** + * Retrieves the details of a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName); + + /** + * Deletes a nat rule. + * + * @param resourceGroupName The resource group name of the Virtual Network Gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param natRuleName The name of the nat rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, Context context); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Retrieves all nat rules for a particular virtual network gateway. + * + * @param resourceGroupName The resource group name of the virtual network gateway. + * @param virtualNetworkGatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway. + */ + PagedIterable listByVirtualNetworkGateway( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Retrieves the details of a nat rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualNetworkGatewayNatRule Resource 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/VirtualNetworkGatewaySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java new file mode 100644 index 0000000000000..5cc473547fc0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualNetworkGatewaySku details. */ +@Fluent +public final class VirtualNetworkGatewaySku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkGatewaySku.class); + + /* + * Gateway SKU name. + */ + @JsonProperty(value = "name") + private VirtualNetworkGatewaySkuName name; + + /* + * Gateway SKU tier. + */ + @JsonProperty(value = "tier") + private VirtualNetworkGatewaySkuTier tier; + + /* + * The capacity. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private Integer capacity; + + /** + * Get the name property: Gateway SKU name. + * + * @return the name value. + */ + public VirtualNetworkGatewaySkuName name() { + return this.name; + } + + /** + * Set the name property: Gateway SKU name. + * + * @param name the name value to set. + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withName(VirtualNetworkGatewaySkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gateway SKU tier. + * + * @return the tier value. + */ + public VirtualNetworkGatewaySkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Gateway SKU tier. + * + * @param tier the tier value to set. + * @return the VirtualNetworkGatewaySku object itself. + */ + public VirtualNetworkGatewaySku withTier(VirtualNetworkGatewaySkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: The capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java new file mode 100644 index 0000000000000..9587145a6467c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewaySkuName. */ +public final class VirtualNetworkGatewaySkuName extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw4 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW4 = fromString("VpnGw4"); + + /** Static value VpnGw5 for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW5 = fromString("VpnGw5"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value VpnGw4AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW4AZ = fromString("VpnGw4AZ"); + + /** Static value VpnGw5AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName VPN_GW5AZ = fromString("VpnGw5AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuName. + */ + @JsonCreator + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** @return known VirtualNetworkGatewaySkuName values. */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuName.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java new file mode 100644 index 0000000000000..22fe33da02c22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewaySkuTier. */ +public final class VirtualNetworkGatewaySkuTier extends ExpandableStringEnum { + /** Static value Basic for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier BASIC = fromString("Basic"); + + /** Static value HighPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier HIGH_PERFORMANCE = fromString("HighPerformance"); + + /** Static value Standard for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier STANDARD = fromString("Standard"); + + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = fromString("UltraPerformance"); + + /** Static value VpnGw1 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1 = fromString("VpnGw1"); + + /** Static value VpnGw2 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2 = fromString("VpnGw2"); + + /** Static value VpnGw3 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3 = fromString("VpnGw3"); + + /** Static value VpnGw4 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW4 = fromString("VpnGw4"); + + /** Static value VpnGw5 for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW5 = fromString("VpnGw5"); + + /** Static value VpnGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW1AZ = fromString("VpnGw1AZ"); + + /** Static value VpnGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW2AZ = fromString("VpnGw2AZ"); + + /** Static value VpnGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW3AZ = fromString("VpnGw3AZ"); + + /** Static value VpnGw4AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW4AZ = fromString("VpnGw4AZ"); + + /** Static value VpnGw5AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier VPN_GW5AZ = fromString("VpnGw5AZ"); + + /** Static value ErGw1AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW1AZ = fromString("ErGw1AZ"); + + /** Static value ErGw2AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW2AZ = fromString("ErGw2AZ"); + + /** Static value ErGw3AZ for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ER_GW3AZ = fromString("ErGw3AZ"); + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuTier. + */ + @JsonCreator + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** @return known VirtualNetworkGatewaySkuTier values. */ + public static Collection values() { + return values(VirtualNetworkGatewaySkuTier.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java new file mode 100644 index 0000000000000..7d56db74c3c8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkGatewayType. */ +public final class VirtualNetworkGatewayType extends ExpandableStringEnum { + /** Static value Vpn for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType VPN = fromString("Vpn"); + + /** Static value ExpressRoute for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** Static value LocalGateway for VirtualNetworkGatewayType. */ + public static final VirtualNetworkGatewayType LOCAL_GATEWAY = fromString("LocalGateway"); + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayType. + */ + @JsonCreator + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** @return known VirtualNetworkGatewayType values. */ + public static Collection values() { + return values(VirtualNetworkGatewayType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java new file mode 100644 index 0000000000000..d20ebcd12d566 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java @@ -0,0 +1,675 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; + +/** Resource collection API of VirtualNetworkGateways. */ +public interface VirtualNetworkGateways { + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group. + */ + VirtualNetworkGateway getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Deletes the specified virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual network gateways by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network gateways by resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets all the connections in a virtual network gateway. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the connections in a virtual network gateway. + */ + PagedIterable listConnections( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the primary of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active feature + * enabled gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a common class for general resource information. + */ + VirtualNetworkGateway reset( + String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Resets the VPN client shared key of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generatevpnclientpackage( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters); + + /** + * Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for + * IKEV2 and radius based authentication. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String generateVpnProfile( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters, Context context); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The + * profile needs to be generated first using generateVpnProfile. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. + */ + String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The GetBgpPeerStatus operation retrieves the status of all BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer to retrieve the status of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list BGP peer status API service call. + */ + BgpPeerStatusListResult getBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices. + */ + String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Gets a xml format representation for supported vpn devices. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for supported vpn devices along with {@link Response}. + */ + Response supportedVpnDevicesWithResponse( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from + * BGP peers. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getLearnedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer); + + /** + * This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param peer The IP address of the peer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of virtual network gateway routes. + */ + GatewayRouteListResult getAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, VpnClientIPsecParametersInner vpnclientIpsecParams); + + /** + * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network + * gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param vpnclientIpsecParams Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network + * Gateway P2S client operation through Network resource provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters setVpnclientIpsecParameters( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, + Context context); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client + * of virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The virtual network gateway name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an IPSec parameters for a virtual network gateway P2S connection. + */ + VpnClientIPsecParameters getVpnclientIpsecParameters( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script. + */ + String vpnDeviceConfigurationScript( + String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters); + + /** + * Gets a xml format representation for vpn device configuration script. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the + * configuration script is generated. + * @param parameters Parameters supplied to the generate vpn device script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a xml format representation for vpn device configuration script along with {@link Response}. + */ + Response vpnDeviceConfigurationScriptWithResponse( + String resourceGroupName, + String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters, + Context context); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Starts packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to start packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String virtualNetworkGatewayName, + VpnPacketCaptureStopParameters parameters, + Context context); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName); + + /** + * Get VPN client connection health detail per P2S client connection of the virtual network gateway in the specified + * resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vPN client connection health detail per P2S client connection of the virtual network gateway in the + * specified resource group. + */ + VpnClientConnectionHealthDetailListResult getVpnclientConnectionHealth( + String resourceGroupName, String virtualNetworkGatewayName, Context context); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request); + + /** + * Disconnect vpn connections of virtual network gateway in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param request The parameters are supplied to disconnect vpn connections. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context); + + /** + * Gets the specified virtual network gateway by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network gateway by resource group 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..5fad08c0ba080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the ListVirtualNetworks API service call. */ +@Fluent +public final class VirtualNetworkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListResult.class); + + /* + * A list of VirtualNetwork resources in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of VirtualNetwork resources in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetwork resources in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkListResult object itself. + */ + public VirtualNetworkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkListResult object itself. + */ + public VirtualNetworkListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java new file mode 100644 index 0000000000000..95d90a8fdf375 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for the virtual networks GetUsage API service call. */ +@Fluent +public final class VirtualNetworkListUsageResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkListUsageResult.class); + + /* + * VirtualNetwork usage stats. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: VirtualNetwork usage stats. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkListUsageResult object itself. + */ + public VirtualNetworkListUsageResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java new file mode 100644 index 0000000000000..96913118f8687 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java @@ -0,0 +1,596 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner object. + * + * @return the inner object. + */ + VirtualNetworkPeeringInner innerModel(); + + /** The entirety of the VirtualNetworkPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualNetworkPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualNetworkPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualNetworkName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the next definition stage. + */ + WithCreate withExistingVirtualNetwork(String resourceGroupName, String virtualNetworkName); + } + /** + * The stage of the VirtualNetworkPeering definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithType, + DefinitionStages.WithAllowVirtualNetworkAccess, + DefinitionStages.WithAllowForwardedTraffic, + DefinitionStages.WithAllowGatewayTransit, + DefinitionStages.WithUseRemoteGateways, + DefinitionStages.WithRemoteVirtualNetwork, + DefinitionStages.WithRemoteAddressSpace, + DefinitionStages.WithRemoteVirtualNetworkAddressSpace, + DefinitionStages.WithRemoteBgpCommunities, + DefinitionStages.WithPeeringState, + DefinitionStages.WithPeeringSyncLevel, + DefinitionStages.WithDoNotVerifyRemoteGateways, + DefinitionStages.WithSyncRemoteAddressSpace { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkPeering create(Context context); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + WithCreate withType(String type); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + WithCreate withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + WithCreate withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + WithCreate withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + WithCreate withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + WithCreate withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + WithCreate withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + WithCreate withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + WithCreate withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + WithCreate withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering definition allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + WithCreate withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Begins update for the VirtualNetworkPeering resource. + * + * @return the stage of resource update. + */ + VirtualNetworkPeering.Update update(); + + /** The template for VirtualNetworkPeering update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithType, + UpdateStages.WithAllowVirtualNetworkAccess, + UpdateStages.WithAllowForwardedTraffic, + UpdateStages.WithAllowGatewayTransit, + UpdateStages.WithUseRemoteGateways, + UpdateStages.WithRemoteVirtualNetwork, + UpdateStages.WithRemoteAddressSpace, + UpdateStages.WithRemoteVirtualNetworkAddressSpace, + UpdateStages.WithRemoteBgpCommunities, + UpdateStages.WithPeeringState, + UpdateStages.WithPeeringSyncLevel, + UpdateStages.WithDoNotVerifyRemoteGateways, + UpdateStages.WithSyncRemoteAddressSpace { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkPeering apply(Context context); + } + /** The VirtualNetworkPeering update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualNetworkPeering update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Resource type.. + * + * @param type Resource type. + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowVirtualNetworkAccess. */ + interface WithAllowVirtualNetworkAccess { + /** + * Specifies the allowVirtualNetworkAccess property: Whether the VMs in the local virtual network space + * would be able to access the VMs in remote virtual network space.. + * + * @param allowVirtualNetworkAccess Whether the VMs in the local virtual network space would be able to + * access the VMs in remote virtual network space. + * @return the next definition stage. + */ + Update withAllowVirtualNetworkAccess(Boolean allowVirtualNetworkAccess); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowForwardedTraffic. */ + interface WithAllowForwardedTraffic { + /** + * Specifies the allowForwardedTraffic property: Whether the forwarded traffic from the VMs in the local + * virtual network will be allowed/disallowed in remote virtual network.. + * + * @param allowForwardedTraffic Whether the forwarded traffic from the VMs in the local virtual network will + * be allowed/disallowed in remote virtual network. + * @return the next definition stage. + */ + Update withAllowForwardedTraffic(Boolean allowForwardedTraffic); + } + /** The stage of the VirtualNetworkPeering update allowing to specify allowGatewayTransit. */ + interface WithAllowGatewayTransit { + /** + * Specifies the allowGatewayTransit property: If gateway links can be used in remote virtual networking to + * link to this virtual network.. + * + * @param allowGatewayTransit If gateway links can be used in remote virtual networking to link to this + * virtual network. + * @return the next definition stage. + */ + Update withAllowGatewayTransit(Boolean allowGatewayTransit); + } + /** The stage of the VirtualNetworkPeering update allowing to specify useRemoteGateways. */ + interface WithUseRemoteGateways { + /** + * Specifies the useRemoteGateways property: If remote gateways can be used on this virtual network. If the + * flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use + * gateways of remote virtual network for transit. Only one peering can have this flag set to true. This + * flag cannot be set if virtual network already has a gateway.. + * + * @param useRemoteGateways If remote gateways can be used on this virtual network. If the flag is set to + * true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot + * be set if virtual network already has a gateway. + * @return the next definition stage. + */ + Update withUseRemoteGateways(Boolean useRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetwork. */ + interface WithRemoteVirtualNetwork { + /** + * Specifies the remoteVirtualNetwork property: The reference to the remote virtual network. The remote + * virtual network can be in the same or different region (preview). See here to register for the preview + * and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering).. + * + * @param remoteVirtualNetwork The reference to the remote virtual network. The remote virtual network can + * be in the same or different region (preview). See here to register for the preview and learn more + * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + * @return the next definition stage. + */ + Update withRemoteVirtualNetwork(SubResource remoteVirtualNetwork); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteAddressSpace. */ + interface WithRemoteAddressSpace { + /** + * Specifies the remoteAddressSpace property: The reference to the address space peered with the remote + * virtual network.. + * + * @param remoteAddressSpace The reference to the address space peered with the remote virtual network. + * @return the next definition stage. + */ + Update withRemoteAddressSpace(AddressSpace remoteAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteVirtualNetworkAddressSpace. */ + interface WithRemoteVirtualNetworkAddressSpace { + /** + * Specifies the remoteVirtualNetworkAddressSpace property: The reference to the current address space of + * the remote virtual network.. + * + * @param remoteVirtualNetworkAddressSpace The reference to the current address space of the remote virtual + * network. + * @return the next definition stage. + */ + Update withRemoteVirtualNetworkAddressSpace(AddressSpace remoteVirtualNetworkAddressSpace); + } + /** The stage of the VirtualNetworkPeering update allowing to specify remoteBgpCommunities. */ + interface WithRemoteBgpCommunities { + /** + * Specifies the remoteBgpCommunities property: The reference to the remote virtual network's Bgp + * Communities.. + * + * @param remoteBgpCommunities The reference to the remote virtual network's Bgp Communities. + * @return the next definition stage. + */ + Update withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringState. */ + interface WithPeeringState { + /** + * Specifies the peeringState property: The status of the virtual network peering.. + * + * @param peeringState The status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringState(VirtualNetworkPeeringState peeringState); + } + /** The stage of the VirtualNetworkPeering update allowing to specify peeringSyncLevel. */ + interface WithPeeringSyncLevel { + /** + * Specifies the peeringSyncLevel property: The peering sync status of the virtual network peering.. + * + * @param peeringSyncLevel The peering sync status of the virtual network peering. + * @return the next definition stage. + */ + Update withPeeringSyncLevel(VirtualNetworkPeeringLevel peeringSyncLevel); + } + /** The stage of the VirtualNetworkPeering update allowing to specify doNotVerifyRemoteGateways. */ + interface WithDoNotVerifyRemoteGateways { + /** + * Specifies the doNotVerifyRemoteGateways property: If we need to verify the provisioning state of the + * remote gateway.. + * + * @param doNotVerifyRemoteGateways If we need to verify the provisioning state of the remote gateway. + * @return the next definition stage. + */ + Update withDoNotVerifyRemoteGateways(Boolean doNotVerifyRemoteGateways); + } + /** The stage of the VirtualNetworkPeering update allowing to specify syncRemoteAddressSpace. */ + interface WithSyncRemoteAddressSpace { + /** + * Specifies the syncRemoteAddressSpace property: Parameter indicates the intention to sync the peering with + * the current address space on the remote vNet after it's updated.. + * + * @param syncRemoteAddressSpace Parameter indicates the intention to sync the peering with the current + * address space on the remote vNet after it's updated. + * @return the next definition stage. + */ + Update withSyncRemoteAddressSpace(SyncRemoteAddressSpace syncRemoteAddressSpace); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java new file mode 100644 index 0000000000000..8b31e5b4c428f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPeeringLevel. */ +public final class VirtualNetworkPeeringLevel extends ExpandableStringEnum { + /** Static value FullyInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel FULLY_IN_SYNC = fromString("FullyInSync"); + + /** Static value RemoteNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel REMOTE_NOT_IN_SYNC = fromString("RemoteNotInSync"); + + /** Static value LocalNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel LOCAL_NOT_IN_SYNC = fromString("LocalNotInSync"); + + /** Static value LocalAndRemoteNotInSync for VirtualNetworkPeeringLevel. */ + public static final VirtualNetworkPeeringLevel LOCAL_AND_REMOTE_NOT_IN_SYNC = fromString("LocalAndRemoteNotInSync"); + + /** + * Creates or finds a VirtualNetworkPeeringLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringLevel. + */ + @JsonCreator + public static VirtualNetworkPeeringLevel fromString(String name) { + return fromString(name, VirtualNetworkPeeringLevel.class); + } + + /** @return known VirtualNetworkPeeringLevel values. */ + public static Collection values() { + return values(VirtualNetworkPeeringLevel.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java new file mode 100644 index 0000000000000..8212a5e4932ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. */ +@Fluent +public final class VirtualNetworkPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkPeeringListResult.class); + + /* + * The peerings in a virtual network. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The peerings in a virtual network. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The peerings in a virtual network. + * + * @param value the value value to set. + * @return the VirtualNetworkPeeringListResult object itself. + */ + public VirtualNetworkPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkPeeringListResult object itself. + */ + public VirtualNetworkPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java new file mode 100644 index 0000000000000..c1e276e78b651 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPeeringState. */ +public final class VirtualNetworkPeeringState extends ExpandableStringEnum { + /** Static value Initiated for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState INITIATED = fromString("Initiated"); + + /** Static value Connected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState CONNECTED = fromString("Connected"); + + /** Static value Disconnected for VirtualNetworkPeeringState. */ + public static final VirtualNetworkPeeringState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringState. + */ + @JsonCreator + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** @return known VirtualNetworkPeeringState values. */ + public static Collection values() { + return values(VirtualNetworkPeeringState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java new file mode 100644 index 0000000000000..d535b9a83ee3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkPeerings. */ +public interface VirtualNetworkPeerings { + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Deletes the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering. + */ + VirtualNetworkPeering get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName); + + /** + * Gets the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, Context context); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName); + + /** + * Gets all virtual network peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual network peerings in a virtual network. + */ + PagedIterable list(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified virtual network peering. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network peering 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..0a8306899f29f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPrivateEndpointNetworkPolicies. */ +public final class VirtualNetworkPrivateEndpointNetworkPolicies + extends ExpandableStringEnum { + /** Static value Enabled for VirtualNetworkPrivateEndpointNetworkPolicies. */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies ENABLED = fromString("Enabled"); + + /** Static value Disabled for VirtualNetworkPrivateEndpointNetworkPolicies. */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies DISABLED = fromString("Disabled"); + + /** + * Creates or finds a VirtualNetworkPrivateEndpointNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateEndpointNetworkPolicies. + */ + @JsonCreator + public static VirtualNetworkPrivateEndpointNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateEndpointNetworkPolicies.class); + } + + /** @return known VirtualNetworkPrivateEndpointNetworkPolicies values. */ + public static Collection values() { + return values(VirtualNetworkPrivateEndpointNetworkPolicies.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java new file mode 100644 index 0000000000000..34fc8246d8567 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ +public final class VirtualNetworkPrivateLinkServiceNetworkPolicies + extends ExpandableStringEnum { + /** Static value Enabled for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ + public static final VirtualNetworkPrivateLinkServiceNetworkPolicies ENABLED = fromString("Enabled"); + + /** Static value Disabled for VirtualNetworkPrivateLinkServiceNetworkPolicies. */ + public static final VirtualNetworkPrivateLinkServiceNetworkPolicies DISABLED = fromString("Disabled"); + + /** + * Creates or finds a VirtualNetworkPrivateLinkServiceNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateLinkServiceNetworkPolicies. + */ + @JsonCreator + public static VirtualNetworkPrivateLinkServiceNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateLinkServiceNetworkPolicies.class); + } + + /** @return known VirtualNetworkPrivateLinkServiceNetworkPolicies values. */ + public static Collection values() { + return values(VirtualNetworkPrivateLinkServiceNetworkPolicies.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java new file mode 100644 index 0000000000000..761a6b9c7e400 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualNetworkTap. */ +public interface VirtualNetworkTap { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner object. + * + * @return the inner object. + */ + VirtualNetworkTapInner innerModel(); + + /** The entirety of the VirtualNetworkTap definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualNetworkTap definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualNetworkTap definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualNetworkTap definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualNetworkTap definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualNetworkTap definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDestinationNetworkInterfaceIpConfiguration, + DefinitionStages.WithDestinationLoadBalancerFrontEndIpConfiguration, + DefinitionStages.WithDestinationPort { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualNetworkTap create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualNetworkTap create(Context context); + } + /** The stage of the VirtualNetworkTap definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** + * The stage of the VirtualNetworkTap definition allowing to specify destinationNetworkInterfaceIpConfiguration. + */ + interface WithDestinationNetworkInterfaceIpConfiguration { + /** + * Specifies the destinationNetworkInterfaceIpConfiguration property: The reference to the private IP + * Address of the collector nic that will receive the tap.. + * + * @param destinationNetworkInterfaceIpConfiguration The reference to the private IP Address of the + * collector nic that will receive the tap. + * @return the next definition stage. + */ + WithCreate withDestinationNetworkInterfaceIpConfiguration( + NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration); + } + /** + * The stage of the VirtualNetworkTap definition allowing to specify + * destinationLoadBalancerFrontEndIpConfiguration. + */ + interface WithDestinationLoadBalancerFrontEndIpConfiguration { + /** + * Specifies the destinationLoadBalancerFrontEndIpConfiguration property: The reference to the private IP + * address on the internal Load Balancer that will receive the tap.. + * + * @param destinationLoadBalancerFrontEndIpConfiguration The reference to the private IP address on the + * internal Load Balancer that will receive the tap. + * @return the next definition stage. + */ + WithCreate withDestinationLoadBalancerFrontEndIpConfiguration( + FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration); + } + /** The stage of the VirtualNetworkTap definition allowing to specify destinationPort. */ + interface WithDestinationPort { + /** + * Specifies the destinationPort property: The VXLAN destination port that will receive the tapped traffic.. + * + * @param destinationPort The VXLAN destination port that will receive the tapped traffic. + * @return the next definition stage. + */ + WithCreate withDestinationPort(Integer destinationPort); + } + } + /** + * Begins update for the VirtualNetworkTap resource. + * + * @return the stage of resource update. + */ + VirtualNetworkTap.Update update(); + + /** The template for VirtualNetworkTap update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualNetworkTap apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualNetworkTap apply(Context context); + } + /** The VirtualNetworkTap update stages. */ + interface UpdateStages { + /** The stage of the VirtualNetworkTap update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualNetworkTap refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualNetworkTap refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java new file mode 100644 index 0000000000000..23d1bd19b8bf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualNetworkTap API service call. */ +@Fluent +public final class VirtualNetworkTapListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkTapListResult.class); + + /* + * A list of VirtualNetworkTaps in a resource group. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A list of VirtualNetworkTaps in a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of VirtualNetworkTaps in a resource group. + * + * @param value the value value to set. + * @return the VirtualNetworkTapListResult object itself. + */ + public VirtualNetworkTapListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualNetworkTapListResult object itself. + */ + public VirtualNetworkTapListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/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..1d7d76f28c8ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworkTaps. */ +public interface VirtualNetworkTaps { + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String tapName); + + /** + * Deletes the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of the virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String tapName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap. + */ + VirtualNetworkTap getByResourceGroup(String resourceGroupName, String tapName); + + /** + * Gets information about the specified virtual network tap. + * + * @param resourceGroupName The name of the resource group. + * @param tapName The name of virtual network tap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String tapName, Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the VirtualNetworkTaps in a subscription. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the VirtualNetworkTaps in a subscription. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets information about the specified virtual network tap. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the specified virtual network tap 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..626d6ab9f7522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Usage strings container. */ +@Immutable +public final class VirtualNetworkUsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkUsageName.class); + + /* + * Localized subnet size and usage string. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /* + * Subnet size and usage string. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the localizedValue property: Localized subnet size and usage string. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Get the value property: Subnet size and usage string. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java new file mode 100644 index 0000000000000..7cced0c7f6af3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualNetworks. */ +public interface VirtualNetworks { + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * Deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group. + */ + VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); + + /** + * Gets the specified virtual network by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualNetworkName, String expand, Context context); + + /** + * Gets all virtual networks in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + PagedIterable list(); + + /** + * Gets all virtual networks in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all virtual networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all virtual networks in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call. + */ + IpAddressAvailabilityResult checkIpAddressAvailability( + String resourceGroupName, String virtualNetworkName, String ipAddress); + + /** + * Checks whether a private IP address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for CheckIPAddressAvailability API service call along with {@link Response}. + */ + Response checkIpAddressAvailabilityWithResponse( + String resourceGroupName, String virtualNetworkName, String ipAddress, Context context); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName); + + /** + * Lists usage stats. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call. + */ + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the specified virtual network by resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified virtual network by resource group 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..b4168254c8c59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualRouter. */ +public interface VirtualRouter { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner object. + * + * @return the inner object. + */ + VirtualRouterInner innerModel(); + + /** The entirety of the VirtualRouter definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualRouter definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualRouter definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualRouter definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualRouter definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualRouter definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithVirtualRouterAsn, + DefinitionStages.WithVirtualRouterIps, + DefinitionStages.WithHostedSubnet, + DefinitionStages.WithHostedGateway { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualRouter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualRouter create(Context context); + } + /** The stage of the VirtualRouter definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualRouter definition allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + WithCreate withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualRouter definition allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + WithCreate withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualRouter definition allowing to specify hostedSubnet. */ + interface WithHostedSubnet { + /** + * Specifies the hostedSubnet property: The Subnet on which VirtualRouter is hosted.. + * + * @param hostedSubnet The Subnet on which VirtualRouter is hosted. + * @return the next definition stage. + */ + WithCreate withHostedSubnet(SubResource hostedSubnet); + } + /** The stage of the VirtualRouter definition allowing to specify hostedGateway. */ + interface WithHostedGateway { + /** + * Specifies the hostedGateway property: The Gateway on which VirtualRouter is hosted.. + * + * @param hostedGateway The Gateway on which VirtualRouter is hosted. + * @return the next definition stage. + */ + WithCreate withHostedGateway(SubResource hostedGateway); + } + } + /** + * Begins update for the VirtualRouter resource. + * + * @return the stage of resource update. + */ + VirtualRouter.Update update(); + + /** The template for VirtualRouter update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithVirtualRouterAsn, + UpdateStages.WithVirtualRouterIps, + UpdateStages.WithHostedSubnet, + UpdateStages.WithHostedGateway { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualRouter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualRouter apply(Context context); + } + /** The VirtualRouter update stages. */ + interface UpdateStages { + /** The stage of the VirtualRouter update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the VirtualRouter update allowing to specify virtualRouterAsn. */ + interface WithVirtualRouterAsn { + /** + * Specifies the virtualRouterAsn property: VirtualRouter ASN.. + * + * @param virtualRouterAsn VirtualRouter ASN. + * @return the next definition stage. + */ + Update withVirtualRouterAsn(Long virtualRouterAsn); + } + /** The stage of the VirtualRouter update allowing to specify virtualRouterIps. */ + interface WithVirtualRouterIps { + /** + * Specifies the virtualRouterIps property: VirtualRouter IPs.. + * + * @param virtualRouterIps VirtualRouter IPs. + * @return the next definition stage. + */ + Update withVirtualRouterIps(List virtualRouterIps); + } + /** The stage of the VirtualRouter update allowing to specify hostedSubnet. */ + interface WithHostedSubnet { + /** + * Specifies the hostedSubnet property: The Subnet on which VirtualRouter is hosted.. + * + * @param hostedSubnet The Subnet on which VirtualRouter is hosted. + * @return the next definition stage. + */ + Update withHostedSubnet(SubResource hostedSubnet); + } + /** The stage of the VirtualRouter update allowing to specify hostedGateway. */ + interface WithHostedGateway { + /** + * Specifies the hostedGateway property: The Gateway on which VirtualRouter is hosted.. + * + * @param hostedGateway The Gateway on which VirtualRouter is hosted. + * @return the next definition stage. + */ + Update withHostedGateway(SubResource hostedGateway); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualRouter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualRouter refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java new file mode 100644 index 0000000000000..ae48ce2548ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouters API service call. */ +@Fluent +public final class VirtualRouterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterListResult.class); + + /* + * List of Virtual Routers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Virtual Routers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Virtual Routers. + * + * @param value the value value to set. + * @return the VirtualRouterListResult object itself. + */ + public VirtualRouterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualRouterListResult object itself. + */ + public VirtualRouterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java new file mode 100644 index 0000000000000..4588eca51a81a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; + +/** An immutable client-side representation of VirtualRouterPeering. */ +public interface VirtualRouterPeering { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the virtual router peering that is unique within a virtual router. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Peering type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + Long peerAsn(); + + /** + * Gets the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + String peerIp(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner object. + * + * @return the inner object. + */ + VirtualRouterPeeringInner innerModel(); + + /** The entirety of the VirtualRouterPeering definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VirtualRouterPeering definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualRouterPeering definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VirtualRouterPeering definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualRouterName. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @return the next definition stage. + */ + WithCreate withExistingVirtualRouter(String resourceGroupName, String virtualRouterName); + } + /** + * The stage of the VirtualRouterPeering definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, DefinitionStages.WithPeerAsn, DefinitionStages.WithPeerIp { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualRouterPeering create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualRouterPeering create(Context context); + } + /** The stage of the VirtualRouterPeering definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual router peering that is unique within a virtual router.. + * + * @param name Name of the virtual router peering that is unique within a virtual router. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VirtualRouterPeering definition allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + WithCreate withPeerAsn(Long peerAsn); + } + /** The stage of the VirtualRouterPeering definition allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + WithCreate withPeerIp(String peerIp); + } + } + /** + * Begins update for the VirtualRouterPeering resource. + * + * @return the stage of resource update. + */ + VirtualRouterPeering.Update update(); + + /** The template for VirtualRouterPeering update. */ + interface Update extends UpdateStages.WithName, UpdateStages.WithPeerAsn, UpdateStages.WithPeerIp { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualRouterPeering apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualRouterPeering apply(Context context); + } + /** The VirtualRouterPeering update stages. */ + interface UpdateStages { + /** The stage of the VirtualRouterPeering update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: Name of the virtual router peering that is unique within a virtual router.. + * + * @param name Name of the virtual router peering that is unique within a virtual router. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VirtualRouterPeering update allowing to specify peerAsn. */ + interface WithPeerAsn { + /** + * Specifies the peerAsn property: Peer ASN.. + * + * @param peerAsn Peer ASN. + * @return the next definition stage. + */ + Update withPeerAsn(Long peerAsn); + } + /** The stage of the VirtualRouterPeering update allowing to specify peerIp. */ + interface WithPeerIp { + /** + * Specifies the peerIp property: Peer IP.. + * + * @param peerIp Peer IP. + * @return the next definition stage. + */ + Update withPeerIp(String peerIp); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualRouterPeering refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualRouterPeering refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java new file mode 100644 index 0000000000000..764a56e7600a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for ListVirtualRouterPeerings API service call. */ +@Fluent +public final class VirtualRouterPeeringListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualRouterPeeringListResult.class); + + /* + * List of VirtualRouterPeerings in a VirtualRouter. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of VirtualRouterPeerings in a VirtualRouter. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VirtualRouterPeerings in a VirtualRouter. + * + * @param value the value value to set. + * @return the VirtualRouterPeeringListResult object itself. + */ + public VirtualRouterPeeringListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the VirtualRouterPeeringListResult object itself. + */ + public VirtualRouterPeeringListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java new file mode 100644 index 0000000000000..1ab3d6f14c618 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualRouterPeerings. */ +public interface VirtualRouterPeerings { + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Deletes the specified peering from a Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering. + */ + VirtualRouterPeering get(String resourceGroupName, String virtualRouterName, String peeringName); + + /** + * Gets the specified Virtual Router Peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param peeringName The name of the Virtual Router Peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualRouterName, String peeringName, Context context); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + PagedIterable list(String resourceGroupName, String virtualRouterName); + + /** + * Lists all Virtual Router Peerings in a Virtual Router resource. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouterPeerings API service call. + */ + PagedIterable list(String resourceGroupName, String virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router Peering. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router Peering 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..56c8e8cb7f091 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualRouters. */ +public interface VirtualRouters { + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Deletes the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualRouterName, Context context); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router. + */ + VirtualRouter getByResourceGroup(String resourceGroupName, String virtualRouterName); + + /** + * Gets the specified Virtual Router. + * + * @param resourceGroupName The name of the resource group. + * @param virtualRouterName The name of the Virtual Router. + * @param expand Expands referenced resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualRouterName, String expand, Context context); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Virtual Routers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualRouters API service call. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Virtual Routers in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Virtual Routers in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the specified Virtual Router. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.network.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Virtual Router 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..c1ac0f134d68d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualWan. */ +public interface VirtualWan { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner object. + * + * @return the inner object. + */ + VirtualWanInner innerModel(); + + /** The entirety of the VirtualWan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VirtualWan definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualWan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualWan definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualWan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VirtualWan definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithDisableVpnEncryption, + DefinitionStages.WithAllowBranchToBranchTraffic, + DefinitionStages.WithAllowVnetToVnetTraffic, + DefinitionStages.WithTypePropertiesType { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualWan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualWan create(Context context); + } + /** The stage of the VirtualWan definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualWan definition allowing to specify disableVpnEncryption. */ + interface WithDisableVpnEncryption { + /** + * Specifies the disableVpnEncryption property: Vpn encryption to be disabled or not.. + * + * @param disableVpnEncryption Vpn encryption to be disabled or not. + * @return the next definition stage. + */ + WithCreate withDisableVpnEncryption(Boolean disableVpnEncryption); + } + /** The stage of the VirtualWan definition allowing to specify allowBranchToBranchTraffic. */ + interface WithAllowBranchToBranchTraffic { + /** + * Specifies the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed.. + * + * @param allowBranchToBranchTraffic True if branch to branch traffic is allowed. + * @return the next definition stage. + */ + WithCreate withAllowBranchToBranchTraffic(Boolean allowBranchToBranchTraffic); + } + /** The stage of the VirtualWan definition allowing to specify allowVnetToVnetTraffic. */ + interface WithAllowVnetToVnetTraffic { + /** + * Specifies the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed.. + * + * @param allowVnetToVnetTraffic True if Vnet to Vnet traffic is allowed. + * @return the next definition stage. + */ + WithCreate withAllowVnetToVnetTraffic(Boolean allowVnetToVnetTraffic); + } + /** The stage of the VirtualWan definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of the VirtualWAN.. + * + * @param typePropertiesType The type of the VirtualWAN. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + } + /** + * Begins update for the VirtualWan resource. + * + * @return the stage of resource update. + */ + VirtualWan.Update update(); + + /** The template for VirtualWan update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualWan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualWan apply(Context context); + } + /** The VirtualWan update stages. */ + interface UpdateStages { + /** The stage of the VirtualWan update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualWan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualWan refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java new file mode 100644 index 0000000000000..b175234527e3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of SecurityProviders. */ +@Fluent +public final class VirtualWanSecurityProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanSecurityProvider.class); + + /* + * Name of the security provider. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Url of the security provider. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Name of the security provider. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private VirtualWanSecurityProviderType type; + + /** + * Get the name property: Name of the security provider. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the security provider. + * + * @param name the name value to set. + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withName(String name) { + this.name = name; + return this; + } + + /** + * Get the url property: Url of the security provider. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Url of the security provider. + * + * @param url the url value to set. + * @return the VirtualWanSecurityProvider object itself. + */ + public VirtualWanSecurityProvider withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the type property: Name of the security provider. + * + * @return the type value. + */ + public VirtualWanSecurityProviderType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java new file mode 100644 index 0000000000000..a7e850ba6078f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualWanSecurityProviderType. */ +public final class VirtualWanSecurityProviderType extends ExpandableStringEnum { + /** Static value External for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType EXTERNAL = fromString("External"); + + /** Static value Native for VirtualWanSecurityProviderType. */ + public static final VirtualWanSecurityProviderType NATIVE = fromString("Native"); + + /** + * Creates or finds a VirtualWanSecurityProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualWanSecurityProviderType. + */ + @JsonCreator + public static VirtualWanSecurityProviderType fromString(String name) { + return fromString(name, VirtualWanSecurityProviderType.class); + } + + /** @return known VirtualWanSecurityProviderType values. */ + public static Collection values() { + return values(VirtualWanSecurityProviderType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java new file mode 100644 index 0000000000000..44a392862636d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner; +import java.util.List; + +/** An immutable client-side representation of VirtualWanSecurityProviders. */ +public interface VirtualWanSecurityProviders { + /** + * Gets the supportedProviders property: List of VirtualWAN security providers. + * + * @return the supportedProviders value. + */ + List supportedProviders(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualWanSecurityProvidersInner object. + * + * @return the inner object. + */ + VirtualWanSecurityProvidersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java new file mode 100644 index 0000000000000..c4c29b079b54e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Wan Vpn profile parameters Vpn profile generation. */ +@Fluent +public final class VirtualWanVpnProfileParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualWanVpnProfileParameters.class); + + /* + * VpnServerConfiguration partial resource uri with which VirtualWan is + * associated to. + */ + @JsonProperty(value = "vpnServerConfigurationResourceId") + private String vpnServerConfigurationResourceId; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /** + * Get the vpnServerConfigurationResourceId property: VpnServerConfiguration partial resource uri with which + * VirtualWan is associated to. + * + * @return the vpnServerConfigurationResourceId value. + */ + public String vpnServerConfigurationResourceId() { + return this.vpnServerConfigurationResourceId; + } + + /** + * Set the vpnServerConfigurationResourceId property: VpnServerConfiguration partial resource uri with which + * VirtualWan is associated to. + * + * @param vpnServerConfigurationResourceId the vpnServerConfigurationResourceId value to set. + * @return the VirtualWanVpnProfileParameters object itself. + */ + public VirtualWanVpnProfileParameters withVpnServerConfigurationResourceId( + String vpnServerConfigurationResourceId) { + this.vpnServerConfigurationResourceId = vpnServerConfigurationResourceId; + return this; + } + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the VirtualWanVpnProfileParameters object itself. + */ + public VirtualWanVpnProfileParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java new file mode 100644 index 0000000000000..6e5739d9db6e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualWans. */ +public interface VirtualWans { + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource. + */ + VirtualWan getByResourceGroup(String resourceGroupName, String virtualWanName); + + /** + * Retrieves the details of a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualWanName, Context context); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String virtualWanName); + + /** + * Deletes a VirtualWAN. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param virtualWanName The name of the VirtualWAN being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String virtualWanName, Context context); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VirtualWANs in a resource group. + * + * @param resourceGroupName The resource group name of the VirtualWan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VirtualWANs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable list(); + + /** + * Lists all the VirtualWANs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VirtualWAN. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualWAN Resource 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/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..681a6985f127f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of routes that control routing from VirtualHub into a virtual network connection. */ +@Fluent +public final class VnetRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetRoute.class); + + /* + * List of all Static Routes. + */ + @JsonProperty(value = "staticRoutes") + private List staticRoutes; + + /* + * The list of references to HubBgpConnection objects. + */ + @JsonProperty(value = "bgpConnections", access = JsonProperty.Access.WRITE_ONLY) + private List bgpConnections; + + /** + * 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 (staticRoutes() != null) { + staticRoutes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java new file mode 100644 index 0000000000000..4ffa173fac827 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnAuthenticationType. */ +public final class VpnAuthenticationType extends ExpandableStringEnum { + /** Static value Certificate for VpnAuthenticationType. */ + public static final VpnAuthenticationType CERTIFICATE = fromString("Certificate"); + + /** Static value Radius for VpnAuthenticationType. */ + public static final VpnAuthenticationType RADIUS = fromString("Radius"); + + /** Static value AAD for VpnAuthenticationType. */ + public static final VpnAuthenticationType AAD = fromString("AAD"); + + /** + * Creates or finds a VpnAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnAuthenticationType. + */ + @JsonCreator + public static VpnAuthenticationType fromString(String name) { + return fromString(name, VpnAuthenticationType.class); + } + + /** @return known VpnAuthenticationType values. */ + public static Collection values() { + return values(VpnAuthenticationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java new file mode 100644 index 0000000000000..80b4bfaee33e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnClientConfiguration for P2S client. */ +@Fluent +public final class VpnClientConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConfiguration.class); + + /* + * The reference to the address space resource which represents Address + * space for P2S VpnClient. + */ + @JsonProperty(value = "vpnClientAddressPool") + private AddressSpace vpnClientAddressPool; + + /* + * VpnClientRootCertificate for virtual network gateway. + */ + @JsonProperty(value = "vpnClientRootCertificates") + private List vpnClientRootCertificates; + + /* + * VpnClientRevokedCertificate for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientRevokedCertificates") + private List vpnClientRevokedCertificates; + + /* + * VpnClientProtocols for Virtual network gateway. + */ + @JsonProperty(value = "vpnClientProtocols") + private List vpnClientProtocols; + + /* + * VPN authentication types for the virtual network gateway.. + */ + @JsonProperty(value = "vpnAuthenticationTypes") + private List vpnAuthenticationTypes; + + /* + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + @JsonProperty(value = "vpnClientIpsecPolicies") + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + */ + @JsonProperty(value = "radiusServerAddress") + private String radiusServerAddress; + + /* + * The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + */ + @JsonProperty(value = "radiusServerSecret") + private String radiusServerSecret; + + /* + * The radiusServers property for multiple radius server configuration. + */ + @JsonProperty(value = "radiusServers") + private List radiusServers; + + /* + * The AADTenant property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadTenant") + private String aadTenant; + + /* + * The AADAudience property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadAudience") + private String aadAudience; + + /* + * The AADIssuer property of the VirtualNetworkGateway resource for vpn + * client connection used for AAD authentication. + */ + @JsonProperty(value = "aadIssuer") + private String aadIssuer; + + /** + * Get the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @return the vpnClientAddressPool value. + */ + public AddressSpace vpnClientAddressPool() { + return this.vpnClientAddressPool; + } + + /** + * Set the vpnClientAddressPool property: The reference to the address space resource which represents Address space + * for P2S VpnClient. + * + * @param vpnClientAddressPool the vpnClientAddressPool value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. + * + * @return the vpnClientRootCertificates value. + */ + public List vpnClientRootCertificates() { + return this.vpnClientRootCertificates; + } + + /** + * Set the vpnClientRootCertificates property: VpnClientRootCertificate for virtual network gateway. + * + * @param vpnClientRootCertificates the vpnClientRootCertificates value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRootCertificates( + List vpnClientRootCertificates) { + this.vpnClientRootCertificates = vpnClientRootCertificates; + return this; + } + + /** + * Get the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. + * + * @return the vpnClientRevokedCertificates value. + */ + public List vpnClientRevokedCertificates() { + return this.vpnClientRevokedCertificates; + } + + /** + * Set the vpnClientRevokedCertificates property: VpnClientRevokedCertificate for Virtual network gateway. + * + * @param vpnClientRevokedCertificates the vpnClientRevokedCertificates value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates) { + this.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + return this; + } + + /** + * Get the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. + * + * @return the vpnClientProtocols value. + */ + public List vpnClientProtocols() { + return this.vpnClientProtocols; + } + + /** + * Set the vpnClientProtocols property: VpnClientProtocols for Virtual network gateway. + * + * @param vpnClientProtocols the vpnClientProtocols value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientProtocols(List vpnClientProtocols) { + this.vpnClientProtocols = vpnClientProtocols; + return this; + } + + /** + * Get the vpnAuthenticationTypes property: VPN authentication types for the virtual network gateway.. + * + * @return the vpnAuthenticationTypes value. + */ + public List vpnAuthenticationTypes() { + return this.vpnAuthenticationTypes; + } + + /** + * Set the vpnAuthenticationTypes property: VPN authentication types for the virtual network gateway.. + * + * @param vpnAuthenticationTypes the vpnAuthenticationTypes value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnAuthenticationTypes(List vpnAuthenticationTypes) { + this.vpnAuthenticationTypes = vpnAuthenticationTypes; + return this; + } + + /** + * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @return the vpnClientIpsecPolicies value. + */ + public List vpnClientIpsecPolicies() { + return this.vpnClientIpsecPolicies; + } + + /** + * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for virtual network gateway P2S client. + * + * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVpnClientIpsecPolicies(List vpnClientIpsecPolicies) { + this.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + return this; + } + + /** + * Get the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + * + * @return the radiusServerAddress value. + */ + public String radiusServerAddress() { + return this.radiusServerAddress; + } + + /** + * Set the radiusServerAddress property: The radius server address property of the VirtualNetworkGateway resource + * for vpn client connection. + * + * @param radiusServerAddress the radiusServerAddress value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerAddress(String radiusServerAddress) { + this.radiusServerAddress = radiusServerAddress; + return this; + } + + /** + * Get the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @return the radiusServerSecret value. + */ + public String radiusServerSecret() { + return this.radiusServerSecret; + } + + /** + * Set the radiusServerSecret property: The radius secret property of the VirtualNetworkGateway resource for vpn + * client connection. + * + * @param radiusServerSecret the radiusServerSecret value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServerSecret(String radiusServerSecret) { + this.radiusServerSecret = radiusServerSecret; + return this; + } + + /** + * Get the radiusServers property: The radiusServers property for multiple radius server configuration. + * + * @return the radiusServers value. + */ + public List radiusServers() { + return this.radiusServers; + } + + /** + * Set the radiusServers property: The radiusServers property for multiple radius server configuration. + * + * @param radiusServers the radiusServers value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withRadiusServers(List radiusServers) { + this.radiusServers = radiusServers; + return this; + } + + /** + * Get the aadTenant property: The AADTenant property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadTenant value. + */ + public String aadTenant() { + return this.aadTenant; + } + + /** + * Set the aadTenant property: The AADTenant property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadTenant the aadTenant value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadTenant(String aadTenant) { + this.aadTenant = aadTenant; + return this; + } + + /** + * Get the aadAudience property: The AADAudience property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadAudience value. + */ + public String aadAudience() { + return this.aadAudience; + } + + /** + * Set the aadAudience property: The AADAudience property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadAudience the aadAudience value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadAudience(String aadAudience) { + this.aadAudience = aadAudience; + return this; + } + + /** + * Get the aadIssuer property: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @return the aadIssuer value. + */ + public String aadIssuer() { + return this.aadIssuer; + } + + /** + * Set the aadIssuer property: The AADIssuer property of the VirtualNetworkGateway resource for vpn client + * connection used for AAD authentication. + * + * @param aadIssuer the aadIssuer value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withAadIssuer(String aadIssuer) { + this.aadIssuer = aadIssuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vpnClientAddressPool() != null) { + vpnClientAddressPool().validate(); + } + if (vpnClientRootCertificates() != null) { + vpnClientRootCertificates().forEach(e -> e.validate()); + } + if (vpnClientRevokedCertificates() != null) { + vpnClientRevokedCertificates().forEach(e -> e.validate()); + } + if (vpnClientIpsecPolicies() != null) { + vpnClientIpsecPolicies().forEach(e -> e.validate()); + } + if (radiusServers() != null) { + radiusServers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java new file mode 100644 index 0000000000000..6b30226baa4b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VpnClientConnectionHealth properties. */ +@Fluent +public final class VpnClientConnectionHealth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealth.class); + + /* + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + @JsonProperty(value = "totalIngressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIngressBytesTransferred; + + /* + * Total of the Egress Bytes Transferred in this connection. + */ + @JsonProperty(value = "totalEgressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEgressBytesTransferred; + + /* + * The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + */ + @JsonProperty(value = "vpnClientConnectionsCount") + private Integer vpnClientConnectionsCount; + + /* + * List of allocated ip addresses to the connected p2s vpn clients. + */ + @JsonProperty(value = "allocatedIpAddresses") + private List allocatedIpAddresses; + + /** + * Get the totalIngressBytesTransferred property: Total of the Ingress Bytes Transferred in this P2S Vpn connection. + * + * @return the totalIngressBytesTransferred value. + */ + public Long totalIngressBytesTransferred() { + return this.totalIngressBytesTransferred; + } + + /** + * Get the totalEgressBytesTransferred property: Total of the Egress Bytes Transferred in this connection. + * + * @return the totalEgressBytesTransferred value. + */ + public Long totalEgressBytesTransferred() { + return this.totalEgressBytesTransferred; + } + + /** + * Get the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + * + * @return the vpnClientConnectionsCount value. + */ + public Integer vpnClientConnectionsCount() { + return this.vpnClientConnectionsCount; + } + + /** + * Set the vpnClientConnectionsCount property: The total of p2s vpn clients connected at this time to this + * P2SVpnGateway. + * + * @param vpnClientConnectionsCount the vpnClientConnectionsCount value to set. + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withVpnClientConnectionsCount(Integer vpnClientConnectionsCount) { + this.vpnClientConnectionsCount = vpnClientConnectionsCount; + return this; + } + + /** + * Get the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. + * + * @return the allocatedIpAddresses value. + */ + public List allocatedIpAddresses() { + return this.allocatedIpAddresses; + } + + /** + * Set the allocatedIpAddresses property: List of allocated ip addresses to the connected p2s vpn clients. + * + * @param allocatedIpAddresses the allocatedIpAddresses value to set. + * @return the VpnClientConnectionHealth object itself. + */ + public VpnClientConnectionHealth withAllocatedIpAddresses(List allocatedIpAddresses) { + this.allocatedIpAddresses = allocatedIpAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java new file mode 100644 index 0000000000000..2c488b3542183 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client connection health detail. */ +@Immutable +public final class VpnClientConnectionHealthDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientConnectionHealthDetail.class); + + /* + * The vpn client Id. + */ + @JsonProperty(value = "vpnConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionId; + + /* + * The duration time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionDuration", access = JsonProperty.Access.WRITE_ONLY) + private Long vpnConnectionDuration; + + /* + * The start time of a connected vpn client. + */ + @JsonProperty(value = "vpnConnectionTime", access = JsonProperty.Access.WRITE_ONLY) + private String vpnConnectionTime; + + /* + * The public Ip of a connected vpn client. + */ + @JsonProperty(value = "publicIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpAddress; + + /* + * The assigned private Ip of a connected vpn client. + */ + @JsonProperty(value = "privateIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String privateIpAddress; + + /* + * The user name of a connected vpn client. + */ + @JsonProperty(value = "vpnUserName", access = JsonProperty.Access.WRITE_ONLY) + private String vpnUsername; + + /* + * The max band width. + */ + @JsonProperty(value = "maxBandwidth", access = JsonProperty.Access.WRITE_ONLY) + private Long maxBandwidth; + + /* + * The egress packets per second. + */ + @JsonProperty(value = "egressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressPacketsTransferred; + + /* + * The egress bytes per second. + */ + @JsonProperty(value = "egressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long egressBytesTransferred; + + /* + * The ingress packets per second. + */ + @JsonProperty(value = "ingressPacketsTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressPacketsTransferred; + + /* + * The ingress bytes per second. + */ + @JsonProperty(value = "ingressBytesTransferred", access = JsonProperty.Access.WRITE_ONLY) + private Long ingressBytesTransferred; + + /* + * The max packets transferred per second. + */ + @JsonProperty(value = "maxPacketsPerSecond", access = JsonProperty.Access.WRITE_ONLY) + private Long maxPacketsPerSecond; + + /** + * Get the vpnConnectionId property: The vpn client Id. + * + * @return the vpnConnectionId value. + */ + public String vpnConnectionId() { + return this.vpnConnectionId; + } + + /** + * Get the vpnConnectionDuration property: The duration time of a connected vpn client. + * + * @return the vpnConnectionDuration value. + */ + public Long vpnConnectionDuration() { + return this.vpnConnectionDuration; + } + + /** + * Get the vpnConnectionTime property: The start time of a connected vpn client. + * + * @return the vpnConnectionTime value. + */ + public String vpnConnectionTime() { + return this.vpnConnectionTime; + } + + /** + * Get the publicIpAddress property: The public Ip of a connected vpn client. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Get the privateIpAddress property: The assigned private Ip of a connected vpn client. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Get the vpnUsername property: The user name of a connected vpn client. + * + * @return the vpnUsername value. + */ + public String vpnUsername() { + return this.vpnUsername; + } + + /** + * Get the maxBandwidth property: The max band width. + * + * @return the maxBandwidth value. + */ + public Long maxBandwidth() { + return this.maxBandwidth; + } + + /** + * Get the egressPacketsTransferred property: The egress packets per second. + * + * @return the egressPacketsTransferred value. + */ + public Long egressPacketsTransferred() { + return this.egressPacketsTransferred; + } + + /** + * Get the egressBytesTransferred property: The egress bytes per second. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.egressBytesTransferred; + } + + /** + * Get the ingressPacketsTransferred property: The ingress packets per second. + * + * @return the ingressPacketsTransferred value. + */ + public Long ingressPacketsTransferred() { + return this.ingressPacketsTransferred; + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes per second. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.ingressBytesTransferred; + } + + /** + * Get the maxPacketsPerSecond property: The max packets transferred per second. + * + * @return the maxPacketsPerSecond value. + */ + public Long maxPacketsPerSecond() { + return this.maxPacketsPerSecond; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java new file mode 100644 index 0000000000000..b22ace51ba6d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner; +import java.util.List; + +/** An immutable client-side representation of VpnClientConnectionHealthDetailListResult. */ +public interface VpnClientConnectionHealthDetailListResult { + /** + * Gets the value property: List of vpn client connection health. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.VpnClientConnectionHealthDetailListResultInner object. + * + * @return the inner object. + */ + VpnClientConnectionHealthDetailListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java new file mode 100644 index 0000000000000..10b45b05cac88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner; + +/** An immutable client-side representation of VpnClientIPsecParameters. */ +public interface VpnClientIPsecParameters { + /** + * Gets the saLifeTimeSeconds property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * lifetime in seconds for P2S client. + * + * @return the saLifeTimeSeconds value. + */ + int saLifeTimeSeconds(); + + /** + * Gets the saDataSizeKilobytes property: The IPSec Security Association (also called Quick Mode or Phase 2 SA) + * payload size in KB for P2S client.. + * + * @return the saDataSizeKilobytes value. + */ + int saDataSizeKilobytes(); + + /** + * Gets the ipsecEncryption property: The IPSec encryption algorithm (IKE phase 1). + * + * @return the ipsecEncryption value. + */ + IpsecEncryption ipsecEncryption(); + + /** + * Gets the ipsecIntegrity property: The IPSec integrity algorithm (IKE phase 1). + * + * @return the ipsecIntegrity value. + */ + IpsecIntegrity ipsecIntegrity(); + + /** + * Gets the ikeEncryption property: The IKE encryption algorithm (IKE phase 2). + * + * @return the ikeEncryption value. + */ + IkeEncryption ikeEncryption(); + + /** + * Gets the ikeIntegrity property: The IKE integrity algorithm (IKE phase 2). + * + * @return the ikeIntegrity value. + */ + IkeIntegrity ikeIntegrity(); + + /** + * Gets the dhGroup property: The DH Group used in IKE Phase 1 for initial SA. + * + * @return the dhGroup value. + */ + DhGroup dhGroup(); + + /** + * Gets the pfsGroup property: The Pfs Group used in IKE Phase 2 for new child SA. + * + * @return the pfsGroup value. + */ + PfsGroup pfsGroup(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnClientIPsecParametersInner object. + * + * @return the inner object. + */ + VpnClientIPsecParametersInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java new file mode 100644 index 0000000000000..78c6c9a22e259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Client Parameters for package generation. */ +@Fluent +public final class VpnClientParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientParameters.class); + + /* + * VPN client Processor Architecture. + */ + @JsonProperty(value = "processorArchitecture") + private ProcessorArchitecture processorArchitecture; + + /* + * VPN client authentication method. + */ + @JsonProperty(value = "authenticationMethod") + private AuthenticationMethod authenticationMethod; + + /* + * The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external + * radius authentication has been configured with EAPTLS authentication. + */ + @JsonProperty(value = "radiusServerAuthCertificate") + private String radiusServerAuthCertificate; + + /* + * A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based + * authentication with EAPTLS. + */ + @JsonProperty(value = "clientRootCertificates") + private List clientRootCertificates; + + /** + * Get the processorArchitecture property: VPN client Processor Architecture. + * + * @return the processorArchitecture value. + */ + public ProcessorArchitecture processorArchitecture() { + return this.processorArchitecture; + } + + /** + * Set the processorArchitecture property: VPN client Processor Architecture. + * + * @param processorArchitecture the processorArchitecture value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withProcessorArchitecture(ProcessorArchitecture processorArchitecture) { + this.processorArchitecture = processorArchitecture; + return this; + } + + /** + * Get the authenticationMethod property: VPN client authentication method. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: VPN client authentication method. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the radiusServerAuthCertificate property: The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with + * EAPTLS authentication. + * + * @return the radiusServerAuthCertificate value. + */ + public String radiusServerAuthCertificate() { + return this.radiusServerAuthCertificate; + } + + /** + * Set the radiusServerAuthCertificate property: The public certificate data for the radius server authentication + * certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with + * EAPTLS authentication. + * + * @param radiusServerAuthCertificate the radiusServerAuthCertificate value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withRadiusServerAuthCertificate(String radiusServerAuthCertificate) { + this.radiusServerAuthCertificate = radiusServerAuthCertificate; + return this; + } + + /** + * Get the clientRootCertificates property: A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @return the clientRootCertificates value. + */ + public List clientRootCertificates() { + return this.clientRootCertificates; + } + + /** + * Set the clientRootCertificates property: A list of client root certificates public certificate data encoded as + * Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. + * + * @param clientRootCertificates the clientRootCertificates value to set. + * @return the VpnClientParameters object itself. + */ + public VpnClientParameters withClientRootCertificates(List clientRootCertificates) { + this.clientRootCertificates = clientRootCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java new file mode 100644 index 0000000000000..3edf071da7366 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnClientProtocol. */ +public final class VpnClientProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnClientProtocol. */ + public static final VpnClientProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value SSTP for VpnClientProtocol. */ + public static final VpnClientProtocol SSTP = fromString("SSTP"); + + /** Static value OpenVPN for VpnClientProtocol. */ + public static final VpnClientProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnClientProtocol. + */ + @JsonCreator + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** @return known VpnClientProtocol values. */ + public static Collection values() { + return values(VpnClientProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..c2d2b231c68f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRevokedCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client revoked certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRevokedCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRevokedCertificate.class); + + /* + * 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; + + /** + * 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..f6c9e2b34ca06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRootCertificatePropertiesFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VPN client root certificate of virtual network gateway. */ +@Fluent +public final class VpnClientRootCertificate extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnClientRootCertificate.class); + + /* + * 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; + + /** + * 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(); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java new file mode 100644 index 0000000000000..111739abeb6f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import java.util.List; + +/** An immutable client-side representation of VpnConnection. */ +public interface VpnConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the remoteVpnSite property: Id of the connected vpn site. + * + * @return the remoteVpnSite value. + */ + SubResource remoteVpnSite(); + + /** + * Gets the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @return the dpdTimeoutSeconds value. + */ + Integer dpdTimeoutSeconds(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * Gets the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * Gets the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * Gets the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the trafficSelectorPolicies property: The Traffic Selector Policies to be considered by this connection. + * + * @return the trafficSelectorPolicies value. + */ + List trafficSelectorPolicies(); + + /** + * Gets the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * Gets the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + Boolean enableInternetSecurity(); + + /** + * Gets the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @return the vpnLinkConnections value. + */ + List vpnLinkConnections(); + + /** + * Gets the routingConfiguration property: The Routing Configuration indicating the associated and propagated route + * tables on this connection. + * + * @return the routingConfiguration value. + */ + RoutingConfiguration routingConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner object. + * + * @return the inner object. + */ + VpnConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..e80a4c24794c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters on vpn connection. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** + * Get the filterData property: Start Packet capture parameters on vpn connection. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters on vpn connection. + * + * @param filterData the filterData value to set. + * @return the VpnConnectionPacketCaptureStartParameters object itself. + */ + public VpnConnectionPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Get the linkConnectionNames property: List of site link connection names. + * + * @return the linkConnectionNames value. + */ + public List linkConnectionNames() { + return this.linkConnectionNames; + } + + /** + * Set the linkConnectionNames property: List of site link connection names. + * + * @param linkConnectionNames the linkConnectionNames value to set. + * @return the VpnConnectionPacketCaptureStartParameters object itself. + */ + public VpnConnectionPacketCaptureStartParameters withLinkConnectionNames(List linkConnectionNames) { + this.linkConnectionNames = linkConnectionNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..f4ada8509172c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. */ +@Fluent +public final class VpnConnectionPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnConnectionPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on vpn connection. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /* + * List of site link connection names. + */ + @JsonProperty(value = "linkConnectionNames") + private List linkConnectionNames; + + /** + * Get the sasUrl property: SAS url for packet capture on vpn connection. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on vpn connection. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnConnectionPacketCaptureStopParameters object itself. + */ + public VpnConnectionPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Get the linkConnectionNames property: List of site link connection names. + * + * @return the linkConnectionNames value. + */ + public List linkConnectionNames() { + return this.linkConnectionNames; + } + + /** + * Set the linkConnectionNames property: List of site link connection names. + * + * @param linkConnectionNames the linkConnectionNames value to set. + * @return the VpnConnectionPacketCaptureStopParameters object itself. + */ + public VpnConnectionPacketCaptureStopParameters withLinkConnectionNames(List linkConnectionNames) { + this.linkConnectionNames = linkConnectionNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java new file mode 100644 index 0000000000000..d72369441b558 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnConnectionStatus. */ +public final class VpnConnectionStatus extends ExpandableStringEnum { + /** Static value Unknown for VpnConnectionStatus. */ + public static final VpnConnectionStatus UNKNOWN = fromString("Unknown"); + + /** Static value Connecting for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for VpnConnectionStatus. */ + public static final VpnConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value NotConnected for VpnConnectionStatus. */ + public static final VpnConnectionStatus NOT_CONNECTED = fromString("NotConnected"); + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnConnectionStatus. + */ + @JsonCreator + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** @return known VpnConnectionStatus values. */ + public static Collection values() { + return values(VpnConnectionStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java new file mode 100644 index 0000000000000..380626bb5e70f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; + +/** Resource collection API of VpnConnections. */ +public interface VpnConnections { + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection get(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves the details of a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String gatewayName, String connectionName, Context context); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters); + + /** + * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnConnection Resource. + */ + VpnConnection createOrUpdate( + String resourceGroupName, + String gatewayName, + String connectionName, + VpnConnectionInner vpnConnectionParameters, + Context context); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, String connectionName); + + /** + * Deletes a vpn connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, String connectionName, Context context); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Starts packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to start packet capture on gateway + * connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(String resourceGroupName, String gatewayName, String vpnConnectionName); + + /** + * Stops packet capture on Vpn connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param vpnConnectionName The name of the vpn connection. + * @param parameters Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + String vpnConnectionName, + VpnConnectionPacketCaptureStopParameters parameters, + Context context); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName); + + /** + * Retrieves all vpn connections for a particular virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnGateway(String resourceGroupName, String gatewayName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java new file mode 100644 index 0000000000000..d4170abded814 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn device configuration script generation parameters. */ +@Fluent +public final class VpnDeviceScriptParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnDeviceScriptParameters.class); + + /* + * The vendor for the vpn device. + */ + @JsonProperty(value = "vendor") + private String vendor; + + /* + * The device family for the vpn device. + */ + @JsonProperty(value = "deviceFamily") + private String deviceFamily; + + /* + * The firmware version for the vpn device. + */ + @JsonProperty(value = "firmwareVersion") + private String firmwareVersion; + + /** + * Get the vendor property: The vendor for the vpn device. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Set the vendor property: The vendor for the vpn device. + * + * @param vendor the vendor value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withVendor(String vendor) { + this.vendor = vendor; + return this; + } + + /** + * Get the deviceFamily property: The device family for the vpn device. + * + * @return the deviceFamily value. + */ + public String deviceFamily() { + return this.deviceFamily; + } + + /** + * Set the deviceFamily property: The device family for the vpn device. + * + * @param deviceFamily the deviceFamily value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withDeviceFamily(String deviceFamily) { + this.deviceFamily = deviceFamily; + return this; + } + + /** + * Get the firmwareVersion property: The firmware version for the vpn device. + * + * @return the firmwareVersion value. + */ + public String firmwareVersion() { + return this.firmwareVersion; + } + + /** + * Set the firmwareVersion property: The firmware version for the vpn device. + * + * @param firmwareVersion the firmwareVersion value to set. + * @return the VpnDeviceScriptParameters object itself. + */ + public VpnDeviceScriptParameters withFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java new file mode 100644 index 0000000000000..d72e0b4b175e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.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 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(VpnGatewayPacketCaptureStartParameters parameters, Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(VpnGatewayPacketCaptureStopParameters parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java new file mode 100644 index 0000000000000..3f074ff75b67e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnGatewayGeneration. */ +public final class VpnGatewayGeneration extends ExpandableStringEnum { + /** Static value None for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration NONE = fromString("None"); + + /** Static value Generation1 for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration GENERATION1 = fromString("Generation1"); + + /** Static value Generation2 for VpnGatewayGeneration. */ + public static final VpnGatewayGeneration GENERATION2 = fromString("Generation2"); + + /** + * Creates or finds a VpnGatewayGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayGeneration. + */ + @JsonCreator + public static VpnGatewayGeneration fromString(String name) { + return fromString(name, VpnGatewayGeneration.class); + } + + /** @return known VpnGatewayGeneration values. */ + public static Collection values() { + return values(VpnGatewayGeneration.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java new file mode 100644 index 0000000000000..291a851e00357 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP Configuration of a VPN Gateway Resource. */ +@Fluent +public final class VpnGatewayIpConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayIpConfiguration.class); + + /* + * The identifier of the IP configuration for a VPN Gateway. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The public IP address of this IP configuration. + */ + @JsonProperty(value = "publicIpAddress") + private String publicIpAddress; + + /* + * The private IP address of this IP configuration. + */ + @JsonProperty(value = "privateIpAddress") + private String privateIpAddress; + + /** + * Get the id property: The identifier of the IP configuration for a VPN Gateway. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The identifier of the IP configuration for a VPN Gateway. + * + * @param id the id value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the publicIpAddress property: The public IP address of this IP configuration. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: The public IP address of this IP configuration. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of this IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The private IP address of this IP configuration. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the VpnGatewayIpConfiguration object itself. + */ + public VpnGatewayIpConfiguration withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java new file mode 100644 index 0000000000000..afb9d798918b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import java.util.List; + +/** An immutable client-side representation of VpnGatewayNatRule. */ +public interface VpnGatewayNatRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the typePropertiesType property: The type of NAT rule for VPN NAT. + * + * @return the typePropertiesType value. + */ + VpnNatRuleType typePropertiesType(); + + /** + * Gets the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + VpnNatRuleMode mode(); + + /** + * Gets the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + List internalMappings(); + + /** + * Gets the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + List externalMappings(); + + /** + * Gets the ipConfigurationId property: The IP Configuration ID this NAT rule applies to. + * + * @return the ipConfigurationId value. + */ + String ipConfigurationId(); + + /** + * Gets the egressVpnSiteLinkConnections property: List of egress VpnSiteLinkConnections. + * + * @return the egressVpnSiteLinkConnections value. + */ + List egressVpnSiteLinkConnections(); + + /** + * Gets the ingressVpnSiteLinkConnections property: List of ingress VpnSiteLinkConnections. + * + * @return the ingressVpnSiteLinkConnections value. + */ + List ingressVpnSiteLinkConnections(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner object. + * + * @return the inner object. + */ + VpnGatewayNatRuleInner innerModel(); + + /** The entirety of the VpnGatewayNatRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The VpnGatewayNatRule definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnGatewayNatRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the VpnGatewayNatRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, gatewayName. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @return the next definition stage. + */ + WithCreate withExistingVpnGateway(String resourceGroupName, String gatewayName); + } + /** + * The stage of the VpnGatewayNatRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithName, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithMode, + DefinitionStages.WithInternalMappings, + DefinitionStages.WithExternalMappings, + DefinitionStages.WithIpConfigurationId { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnGatewayNatRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnGatewayNatRule create(Context context); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + WithCreate withName(String name); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + WithCreate withMode(VpnNatRuleMode mode); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + WithCreate withInternalMappings(List internalMappings); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + WithCreate withExternalMappings(List externalMappings); + } + /** The stage of the VpnGatewayNatRule definition allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + WithCreate withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Begins update for the VpnGatewayNatRule resource. + * + * @return the stage of resource update. + */ + VpnGatewayNatRule.Update update(); + + /** The template for VpnGatewayNatRule update. */ + interface Update + extends UpdateStages.WithName, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithMode, + UpdateStages.WithInternalMappings, + UpdateStages.WithExternalMappings, + UpdateStages.WithIpConfigurationId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnGatewayNatRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnGatewayNatRule apply(Context context); + } + /** The VpnGatewayNatRule update stages. */ + interface UpdateStages { + /** The stage of the VpnGatewayNatRule update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource that is unique within a resource group. This name + * can be used to access the resource.. + * + * @param name The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the VpnGatewayNatRule update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of NAT rule for VPN NAT.. + * + * @param typePropertiesType The type of NAT rule for VPN NAT. + * @return the next definition stage. + */ + Update withTypePropertiesType(VpnNatRuleType typePropertiesType); + } + /** The stage of the VpnGatewayNatRule update allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The Source NAT direction of a VPN NAT.. + * + * @param mode The Source NAT direction of a VPN NAT. + * @return the next definition stage. + */ + Update withMode(VpnNatRuleMode mode); + } + /** The stage of the VpnGatewayNatRule update allowing to specify internalMappings. */ + interface WithInternalMappings { + /** + * Specifies the internalMappings property: The private IP address internal mapping for NAT.. + * + * @param internalMappings The private IP address internal mapping for NAT. + * @return the next definition stage. + */ + Update withInternalMappings(List internalMappings); + } + /** The stage of the VpnGatewayNatRule update allowing to specify externalMappings. */ + interface WithExternalMappings { + /** + * Specifies the externalMappings property: The private IP address external mapping for NAT.. + * + * @param externalMappings The private IP address external mapping for NAT. + * @return the next definition stage. + */ + Update withExternalMappings(List externalMappings); + } + /** The stage of the VpnGatewayNatRule update allowing to specify ipConfigurationId. */ + interface WithIpConfigurationId { + /** + * Specifies the ipConfigurationId property: The IP Configuration ID this NAT rule applies to.. + * + * @param ipConfigurationId The IP Configuration ID this NAT rule applies to. + * @return the next definition stage. + */ + Update withIpConfigurationId(String ipConfigurationId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnGatewayNatRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnGatewayNatRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..754f038858553 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Start packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters on vpn gateway. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /** + * Get the filterData property: Start Packet capture parameters on vpn gateway. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters on vpn gateway. + * + * @param filterData the filterData value to set. + * @return the VpnGatewayPacketCaptureStartParameters object itself. + */ + public VpnGatewayPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..af5caf08b15af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnGatewayPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnGatewayPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on vpn gateway. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: SAS url for packet capture on vpn gateway. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on vpn gateway. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnGatewayPacketCaptureStopParameters object itself. + */ + public VpnGatewayPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java new file mode 100644 index 0000000000000..1020d101dbf27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnGatewayTunnelingProtocol. */ +public final class VpnGatewayTunnelingProtocol extends ExpandableStringEnum { + /** Static value IkeV2 for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol IKE_V2 = fromString("IkeV2"); + + /** Static value OpenVPN for VpnGatewayTunnelingProtocol. */ + public static final VpnGatewayTunnelingProtocol OPEN_VPN = fromString("OpenVPN"); + + /** + * Creates or finds a VpnGatewayTunnelingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayTunnelingProtocol. + */ + @JsonCreator + public static VpnGatewayTunnelingProtocol fromString(String name) { + return fromString(name, VpnGatewayTunnelingProtocol.class); + } + + /** @return known VpnGatewayTunnelingProtocol values. */ + public static Collection values() { + return values(VpnGatewayTunnelingProtocol.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java new file mode 100644 index 0000000000000..3b8f1b4ba0c13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnGateways. */ +public interface VpnGateways { + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway getByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, Context context); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String gatewayName); + + /** + * Deletes a virtual wan vpn gateway. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String gatewayName, Context context); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(String resourceGroupName, String gatewayName); + + /** + * Resets the primary of the vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource. + */ + VpnGateway reset(String resourceGroupName, String gatewayName, Context context); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStartParameters parameters); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Starts packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String startPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, + Context context); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture(String resourceGroupName, String gatewayName); + + /** + * Stops packet capture on vpn gateway in the specified resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String stopPacketCapture( + String resourceGroupName, + String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, + Context context); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the VpnGateways in a resource group. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnGateways in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable list(); + + /** + * Lists all the VpnGateways in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a virtual wan vpn gateway. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnGateway Resource 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..a97f2f923108c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BGP settings details for a link. */ +@Fluent +public final class VpnLinkBgpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkBgpSettings.class); + + /* + * The BGP speaker's ASN. + */ + @JsonProperty(value = "asn") + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + @JsonProperty(value = "bgpPeeringAddress") + private String bgpPeeringAddress; + + /** + * Get the asn property: The BGP speaker's ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Set the asn property: The BGP speaker's ASN. + * + * @param asn the asn value to set. + * @return the VpnLinkBgpSettings object itself. + */ + public VpnLinkBgpSettings withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @return the bgpPeeringAddress value. + */ + public String bgpPeeringAddress() { + return this.bgpPeeringAddress; + } + + /** + * Set the bgpPeeringAddress property: The BGP peering address and BGP identifier of this BGP speaker. + * + * @param bgpPeeringAddress the bgpPeeringAddress value to set. + * @return the VpnLinkBgpSettings object itself. + */ + public VpnLinkBgpSettings withBgpPeeringAddress(String bgpPeeringAddress) { + this.bgpPeeringAddress = bgpPeeringAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java new file mode 100644 index 0000000000000..69f50355f5609 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnLinkConnectionMode. */ +public final class VpnLinkConnectionMode extends ExpandableStringEnum { + /** Static value Default for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode DEFAULT = fromString("Default"); + + /** Static value ResponderOnly for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode RESPONDER_ONLY = fromString("ResponderOnly"); + + /** Static value InitiatorOnly for VpnLinkConnectionMode. */ + public static final VpnLinkConnectionMode INITIATOR_ONLY = fromString("InitiatorOnly"); + + /** + * Creates or finds a VpnLinkConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnLinkConnectionMode. + */ + @JsonCreator + public static VpnLinkConnectionMode fromString(String name) { + return fromString(name, VpnLinkConnectionMode.class); + } + + /** @return known VpnLinkConnectionMode values. */ + public static Collection values() { + return values(VpnLinkConnectionMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java new file mode 100644 index 0000000000000..c698e19cc01aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of VpnLinkConnections. */ +public interface VpnLinkConnections { + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Resets the VpnLink connection specified. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetConnection( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas(String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn link connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String getIkeSas( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName); + + /** + * Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. + * + * @param resourceGroupName The resource group name of the vpn gateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway. + */ + PagedIterable listByVpnConnection( + String resourceGroupName, String gatewayName, String connectionName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java new file mode 100644 index 0000000000000..546591c7e8061 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List of properties of a link provider. */ +@Fluent +public final class VpnLinkProviderProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnLinkProviderProperties.class); + + /* + * Name of the link provider. + */ + @JsonProperty(value = "linkProviderName") + private String linkProviderName; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeedInMbps") + private Integer linkSpeedInMbps; + + /** + * Get the linkProviderName property: Name of the link provider. + * + * @return the linkProviderName value. + */ + public String linkProviderName() { + return this.linkProviderName; + } + + /** + * Set the linkProviderName property: Name of the link provider. + * + * @param linkProviderName the linkProviderName value to set. + * @return the VpnLinkProviderProperties object itself. + */ + public VpnLinkProviderProperties withLinkProviderName(String linkProviderName) { + this.linkProviderName = linkProviderName; + return this; + } + + /** + * Get the linkSpeedInMbps property: Link speed. + * + * @return the linkSpeedInMbps value. + */ + public Integer linkSpeedInMbps() { + return this.linkSpeedInMbps; + } + + /** + * Set the linkSpeedInMbps property: Link speed. + * + * @param linkSpeedInMbps the linkSpeedInMbps value to set. + * @return the VpnLinkProviderProperties object itself. + */ + public VpnLinkProviderProperties withLinkSpeedInMbps(Integer linkSpeedInMbps) { + this.linkSpeedInMbps = linkSpeedInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.java new file mode 100644 index 0000000000000..6abb0c69df38b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Vpn NatRule mapping. */ +@Fluent +public final class VpnNatRuleMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnNatRuleMapping.class); + + /* + * Address space for Vpn NatRule mapping. + */ + @JsonProperty(value = "addressSpace") + private String addressSpace; + + /* + * Port range for Vpn NatRule mapping. + */ + @JsonProperty(value = "portRange") + private String portRange; + + /** + * 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..71419ad5a0f1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnNatRuleMode. */ +public final class VpnNatRuleMode extends ExpandableStringEnum { + /** Static value EgressSnat for VpnNatRuleMode. */ + public static final VpnNatRuleMode EGRESS_SNAT = fromString("EgressSnat"); + + /** Static value IngressSnat for VpnNatRuleMode. */ + public static final VpnNatRuleMode INGRESS_SNAT = fromString("IngressSnat"); + + /** + * Creates or finds a VpnNatRuleMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleMode. + */ + @JsonCreator + public static VpnNatRuleMode fromString(String name) { + return fromString(name, VpnNatRuleMode.class); + } + + /** @return known VpnNatRuleMode values. */ + public static Collection values() { + return values(VpnNatRuleMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java new file mode 100644 index 0000000000000..eb9bc6a32f3a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnNatRuleType. */ +public final class VpnNatRuleType extends ExpandableStringEnum { + /** Static value Static for VpnNatRuleType. */ + public static final VpnNatRuleType STATIC = fromString("Static"); + + /** Static value Dynamic for VpnNatRuleType. */ + public static final VpnNatRuleType DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a VpnNatRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleType. + */ + @JsonCreator + public static VpnNatRuleType fromString(String name) { + return fromString(name, VpnNatRuleType.class); + } + + /** @return known VpnNatRuleType values. */ + public static Collection values() { + return values(VpnNatRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java new file mode 100644 index 0000000000000..67abefd50777a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Start packet capture parameters on virtual network gateway. */ +@Fluent +public final class VpnPacketCaptureStartParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnPacketCaptureStartParameters.class); + + /* + * Start Packet capture parameters. + */ + @JsonProperty(value = "filterData") + private String filterData; + + /** + * Get the filterData property: Start Packet capture parameters. + * + * @return the filterData value. + */ + public String filterData() { + return this.filterData; + } + + /** + * Set the filterData property: Start Packet capture parameters. + * + * @param filterData the filterData value to set. + * @return the VpnPacketCaptureStartParameters object itself. + */ + public VpnPacketCaptureStartParameters withFilterData(String filterData) { + this.filterData = filterData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java new file mode 100644 index 0000000000000..26d647b2cad05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop packet capture parameters. */ +@Fluent +public final class VpnPacketCaptureStopParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnPacketCaptureStopParameters.class); + + /* + * SAS url for packet capture on virtual network gateway. + */ + @JsonProperty(value = "sasUrl") + private String sasUrl; + + /** + * Get the sasUrl property: SAS url for packet capture on virtual network gateway. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: SAS url for packet capture on virtual network gateway. + * + * @param sasUrl the sasUrl value to set. + * @return the VpnPacketCaptureStopParameters object itself. + */ + public VpnPacketCaptureStopParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java new file mode 100644 index 0000000000000..a4d9b1dc51032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner; + +/** An immutable client-side representation of VpnProfileResponse. */ +public interface VpnProfileResponse { + /** + * Gets the profileUrl property: URL to the VPN profile. + * + * @return the profileUrl value. + */ + String profileUrl(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnProfileResponseInner object. + * + * @return the inner object. + */ + VpnProfileResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java new file mode 100644 index 0000000000000..e7ffb46c6f4be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Radius client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusClientRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigRadiusClientRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Radius client root certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigRadiusClientRootCertificate object itself. + */ + public VpnServerConfigRadiusClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the thumbprint property: The Radius client root certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The Radius client root certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the VpnServerConfigRadiusClientRootCertificate object itself. + */ + public VpnServerConfigRadiusClientRootCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java new file mode 100644 index 0000000000000..f46b6d218de8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Radius Server root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigRadiusServerRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigRadiusServerRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + private String publicCertData; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigRadiusServerRootCertificate object itself. + */ + public VpnServerConfigRadiusServerRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the publicCertData property: The certificate public data. + * + * @param publicCertData the publicCertData value to set. + * @return the VpnServerConfigRadiusServerRootCertificate object itself. + */ + public VpnServerConfigRadiusServerRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java new file mode 100644 index 0000000000000..8206f6621d2eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the revoked VPN client certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRevokedCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigVpnClientRevokedCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The revoked VPN client certificate thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigVpnClientRevokedCertificate object itself. + */ + public VpnServerConfigVpnClientRevokedCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the VpnServerConfigVpnClientRevokedCertificate object itself. + */ + public VpnServerConfigVpnClientRevokedCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java new file mode 100644 index 0000000000000..8aba32193b1ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of VPN client root certificate of VpnServerConfiguration. */ +@Fluent +public final class VpnServerConfigVpnClientRootCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VpnServerConfigVpnClientRootCertificate.class); + + /* + * The certificate name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The certificate public data. + */ + @JsonProperty(value = "publicCertData") + private String publicCertData; + + /** + * Get the name property: The certificate name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The certificate name. + * + * @param name the name value to set. + * @return the VpnServerConfigVpnClientRootCertificate object itself. + */ + public VpnServerConfigVpnClientRootCertificate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.publicCertData; + } + + /** + * Set the publicCertData property: The certificate public data. + * + * @param publicCertData the publicCertData value to set. + * @return the VpnServerConfigVpnClientRootCertificate object itself. + */ + public VpnServerConfigVpnClientRootCertificate withPublicCertData(String publicCertData) { + this.publicCertData = publicCertData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java new file mode 100644 index 0000000000000..500592e1ef119 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VpnServerConfiguration. */ +public interface VpnServerConfiguration { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 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 inner com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner object. + * + * @return the inner object. + */ + VpnServerConfigurationInner innerModel(); + + /** The entirety of the VpnServerConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VpnServerConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnServerConfiguration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VpnServerConfiguration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VpnServerConfiguration definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VpnServerConfiguration definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithNamePropertiesName, + DefinitionStages.WithVpnProtocols, + DefinitionStages.WithVpnAuthenticationTypes, + DefinitionStages.WithVpnClientRootCertificates, + DefinitionStages.WithVpnClientRevokedCertificates, + DefinitionStages.WithRadiusServerRootCertificates, + DefinitionStages.WithRadiusClientRootCertificates, + DefinitionStages.WithVpnClientIpsecPolicies, + DefinitionStages.WithRadiusServerAddress, + DefinitionStages.WithRadiusServerSecret, + DefinitionStages.WithRadiusServers, + DefinitionStages.WithAadAuthenticationParameters { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnServerConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnServerConfiguration create(Context context); + } + /** The stage of the VpnServerConfiguration definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VpnServerConfiguration definition allowing to specify namePropertiesName. */ + interface WithNamePropertiesName { + /** + * Specifies the namePropertiesName property: The name of the VpnServerConfiguration that is unique within a + * resource group.. + * + * @param namePropertiesName The name of the VpnServerConfiguration that is unique within a resource group. + * @return the next definition stage. + */ + WithCreate withNamePropertiesName(String namePropertiesName); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnProtocols. */ + interface WithVpnProtocols { + /** + * Specifies the vpnProtocols property: VPN protocols for the VpnServerConfiguration.. + * + * @param vpnProtocols VPN protocols for the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnProtocols(List vpnProtocols); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnAuthenticationTypes. */ + interface WithVpnAuthenticationTypes { + /** + * Specifies the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration.. + * + * @param vpnAuthenticationTypes VPN authentication types for the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnAuthenticationTypes(List vpnAuthenticationTypes); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientRootCertificates. */ + interface WithVpnClientRootCertificates { + /** + * Specifies the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration.. + * + * @param vpnClientRootCertificates VPN client root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientRootCertificates( + List vpnClientRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientRevokedCertificates. */ + interface WithVpnClientRevokedCertificates { + /** + * Specifies the vpnClientRevokedCertificates property: VPN client revoked certificate of + * VpnServerConfiguration.. + * + * @param vpnClientRevokedCertificates VPN client revoked certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientRevokedCertificates( + List vpnClientRevokedCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerRootCertificates. */ + interface WithRadiusServerRootCertificates { + /** + * Specifies the radiusServerRootCertificates property: Radius Server root certificate of + * VpnServerConfiguration.. + * + * @param radiusServerRootCertificates Radius Server root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusServerRootCertificates( + List radiusServerRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusClientRootCertificates. */ + interface WithRadiusClientRootCertificates { + /** + * Specifies the radiusClientRootCertificates property: Radius client root certificate of + * VpnServerConfiguration.. + * + * @param radiusClientRootCertificates Radius client root certificate of VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusClientRootCertificates( + List radiusClientRootCertificates); + } + /** The stage of the VpnServerConfiguration definition allowing to specify vpnClientIpsecPolicies. */ + interface WithVpnClientIpsecPolicies { + /** + * Specifies the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration.. + * + * @param vpnClientIpsecPolicies VpnClientIpsecPolicies for VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withVpnClientIpsecPolicies(List vpnClientIpsecPolicies); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerAddress. */ + interface WithRadiusServerAddress { + /** + * Specifies the radiusServerAddress property: The radius server address property of the + * VpnServerConfiguration resource for point to site client connection.. + * + * @param radiusServerAddress The radius server address property of the VpnServerConfiguration resource for + * point to site client connection. + * @return the next definition stage. + */ + WithCreate withRadiusServerAddress(String radiusServerAddress); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServerSecret. */ + interface WithRadiusServerSecret { + /** + * Specifies the radiusServerSecret property: The radius secret property of the VpnServerConfiguration + * resource for point to site client connection.. + * + * @param radiusServerSecret The radius secret property of the VpnServerConfiguration resource for point to + * site client connection. + * @return the next definition stage. + */ + WithCreate withRadiusServerSecret(String radiusServerSecret); + } + /** The stage of the VpnServerConfiguration definition allowing to specify radiusServers. */ + interface WithRadiusServers { + /** + * Specifies the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration.. + * + * @param radiusServers Multiple Radius Server configuration for VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withRadiusServers(List radiusServers); + } + /** The stage of the VpnServerConfiguration definition allowing to specify aadAuthenticationParameters. */ + interface WithAadAuthenticationParameters { + /** + * Specifies the aadAuthenticationParameters property: The set of aad vpn authentication parameters.. + * + * @param aadAuthenticationParameters The set of aad vpn authentication parameters. + * @return the next definition stage. + */ + WithCreate withAadAuthenticationParameters(AadAuthenticationParameters aadAuthenticationParameters); + } + } + /** + * Begins update for the VpnServerConfiguration resource. + * + * @return the stage of resource update. + */ + VpnServerConfiguration.Update update(); + + /** The template for VpnServerConfiguration update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnServerConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnServerConfiguration apply(Context context); + } + /** The VpnServerConfiguration update stages. */ + interface UpdateStages { + /** The stage of the VpnServerConfiguration update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnServerConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnServerConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java new file mode 100644 index 0000000000000..9c104e90e1415 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnServerConfigurations. */ +public interface VpnServerConfigurations { + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource. + */ + VpnServerConfiguration getByResourceGroup(String resourceGroupName, String vpnServerConfigurationName); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String vpnServerConfigurationName, Context context); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String vpnServerConfigurationName); + + /** + * Deletes a VpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vpnServerConfigurationName, Context context); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnServerConfigurations in a resource group. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable list(); + + /** + * Lists all the VpnServerConfigurations in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VpnServerConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfiguration Resource 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..e566e4fa20378 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VpnSite. */ +public interface VpnSite { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner object. + * + * @return the inner object. + */ + VpnSiteInner innerModel(); + + /** The entirety of the VpnSite definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The VpnSite definition stages. */ + interface DefinitionStages { + /** The first stage of the VpnSite definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VpnSite definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VpnSite definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the VpnSite definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithVirtualWan, + DefinitionStages.WithDeviceProperties, + DefinitionStages.WithIpAddress, + DefinitionStages.WithSiteKey, + DefinitionStages.WithAddressSpace, + DefinitionStages.WithBgpProperties, + DefinitionStages.WithIsSecuritySite, + DefinitionStages.WithVpnSiteLinks, + DefinitionStages.WithO365Policy { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnSite create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnSite create(Context context); + } + /** The stage of the VpnSite definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VpnSite definition allowing to specify virtualWan. */ + interface WithVirtualWan { + /** + * Specifies the virtualWan property: The VirtualWAN to which the vpnSite belongs.. + * + * @param virtualWan The VirtualWAN to which the vpnSite belongs. + * @return the next definition stage. + */ + WithCreate withVirtualWan(SubResource virtualWan); + } + /** The stage of the VpnSite definition allowing to specify deviceProperties. */ + interface WithDeviceProperties { + /** + * Specifies the deviceProperties property: The device properties.. + * + * @param deviceProperties The device properties. + * @return the next definition stage. + */ + WithCreate withDeviceProperties(DeviceProperties deviceProperties); + } + /** The stage of the VpnSite definition allowing to specify ipAddress. */ + interface WithIpAddress { + /** + * Specifies the ipAddress property: The ip-address for the vpn-site.. + * + * @param ipAddress The ip-address for the vpn-site. + * @return the next definition stage. + */ + WithCreate withIpAddress(String ipAddress); + } + /** The stage of the VpnSite definition allowing to specify siteKey. */ + interface WithSiteKey { + /** + * Specifies the siteKey property: The key for vpn-site that can be used for connections.. + * + * @param siteKey The key for vpn-site that can be used for connections. + * @return the next definition stage. + */ + WithCreate withSiteKey(String siteKey); + } + /** The stage of the VpnSite definition allowing to specify addressSpace. */ + interface WithAddressSpace { + /** + * Specifies the addressSpace property: The AddressSpace that contains an array of IP address ranges.. + * + * @param addressSpace The AddressSpace that contains an array of IP address ranges. + * @return the next definition stage. + */ + WithCreate withAddressSpace(AddressSpace addressSpace); + } + /** The stage of the VpnSite definition allowing to specify bgpProperties. */ + interface WithBgpProperties { + /** + * Specifies the bgpProperties property: The set of bgp properties.. + * + * @param bgpProperties The set of bgp properties. + * @return the next definition stage. + */ + WithCreate withBgpProperties(BgpSettings bgpProperties); + } + /** The stage of the VpnSite definition allowing to specify isSecuritySite. */ + interface WithIsSecuritySite { + /** + * Specifies the isSecuritySite property: IsSecuritySite flag.. + * + * @param isSecuritySite IsSecuritySite flag. + * @return the next definition stage. + */ + WithCreate withIsSecuritySite(Boolean isSecuritySite); + } + /** The stage of the VpnSite definition allowing to specify vpnSiteLinks. */ + interface WithVpnSiteLinks { + /** + * Specifies the vpnSiteLinks property: List of all vpn site links.. + * + * @param vpnSiteLinks List of all vpn site links. + * @return the next definition stage. + */ + WithCreate withVpnSiteLinks(List vpnSiteLinks); + } + /** The stage of the VpnSite definition allowing to specify o365Policy. */ + interface WithO365Policy { + /** + * Specifies the o365Policy property: Office365 Policy.. + * + * @param o365Policy Office365 Policy. + * @return the next definition stage. + */ + WithCreate withO365Policy(O365PolicyProperties o365Policy); + } + } + /** + * Begins update for the VpnSite resource. + * + * @return the stage of resource update. + */ + VpnSite.Update update(); + + /** The template for VpnSite update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnSite apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnSite apply(Context context); + } + /** The VpnSite update stages. */ + interface UpdateStages { + /** The stage of the VpnSite update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnSite refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnSite refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java new file mode 100644 index 0000000000000..da8cd1a2bb6a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; + +/** An immutable client-side representation of VpnSiteLink. */ +public interface VpnSiteLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the linkProperties property: The link provider properties. + * + * @return the linkProperties value. + */ + VpnLinkProviderProperties linkProperties(); + + /** + * Gets the ipAddress property: The ip-address for the vpn-site-link. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the fqdn property: FQDN of vpn-site-link. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + VpnLinkBgpSettings bgpProperties(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site link resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner object. + * + * @return the inner object. + */ + VpnSiteLinkInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java new file mode 100644 index 0000000000000..850254c8ed45d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import java.util.List; + +/** An immutable client-side representation of VpnSiteLinkConnection. */ +public interface VpnSiteLinkConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the vpnSiteLink property: Id of the connected vpn site link. + * + * @return the vpnSiteLink value. + */ + SubResource vpnSiteLink(); + + /** + * Gets the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + Integer routingWeight(); + + /** + * Gets the vpnLinkConnectionMode property: Vpn link connection mode. + * + * @return the vpnLinkConnectionMode value. + */ + VpnLinkConnectionMode vpnLinkConnectionMode(); + + /** + * Gets the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + VpnConnectionStatus connectionStatus(); + + /** + * Gets the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType(); + + /** + * Gets the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + Long ingressBytesTransferred(); + + /** + * Gets the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + Long egressBytesTransferred(); + + /** + * Gets the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + Integer connectionBandwidth(); + + /** + * Gets the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + Boolean enableBgp(); + + /** + * Gets the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + Boolean usePolicyBasedTrafficSelectors(); + + /** + * Gets the ipsecPolicies property: The IPSec Policies to be considered by this connection. + * + * @return the ipsecPolicies value. + */ + List ipsecPolicies(); + + /** + * Gets the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + Boolean enableRateLimiting(); + + /** + * Gets the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + Boolean useLocalAzureIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the VPN site link connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + List ingressNatRules(); + + /** + * Gets the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + List egressNatRules(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner object. + * + * @return the inner object. + */ + VpnSiteLinkConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java new file mode 100644 index 0000000000000..1d685e4ffdb7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSiteLinkConnections. */ +public interface VpnSiteLinkConnections { + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource. + */ + VpnSiteLinkConnection get( + String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName); + + /** + * Retrieves the details of a vpn site link connection. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the vpn connection. + * @param linkConnectionName The name of the vpn connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLinkConnection Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String gatewayName, + String connectionName, + String linkConnectionName, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java new file mode 100644 index 0000000000000..cf0104b3c4a8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSiteLinks. */ +public interface VpnSiteLinks { + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource. + */ + VpnSiteLink get(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName); + + /** + * Retrieves the details of a VPN site link. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param vpnSiteLinkName The name of the VpnSiteLink being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSiteLink Resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, Context context); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName); + + /** + * Lists all the vpnSiteLinks in a resource group for a vpn site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks. + */ + PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java new file mode 100644 index 0000000000000..d640b3630a83a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VpnSites. */ +public interface VpnSites { + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource. + */ + VpnSite getByResourceGroup(String resourceGroupName, String vpnSiteName); + + /** + * Retrieves the details of a VPN site. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vpnSiteName, Context context); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String vpnSiteName); + + /** + * Deletes a VpnSite. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param vpnSiteName The name of the VpnSite being deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String vpnSiteName, Context context); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the vpnSites in a resource group. + * + * @param resourceGroupName The resource group name of the VpnSite. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the VpnSites in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable list(); + + /** + * Lists all the VpnSites in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites. + */ + PagedIterable list(Context context); + + /** + * Retrieves the details of a VPN site. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnSite Resource 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..812ca2ebbe3b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VpnType. */ +public final class VpnType extends ExpandableStringEnum { + /** Static value PolicyBased for VpnType. */ + public static final VpnType POLICY_BASED = fromString("PolicyBased"); + + /** Static value RouteBased for VpnType. */ + public static final VpnType ROUTE_BASED = fromString("RouteBased"); + + /** + * Creates or finds a VpnType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnType. + */ + @JsonCreator + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** @return known VpnType values. */ + public static Collection values() { + return values(VpnType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java new file mode 100644 index 0000000000000..1841fce1911dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallAction. */ +public final class WebApplicationFirewallAction extends ExpandableStringEnum { + /** Static value Allow for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction ALLOW = fromString("Allow"); + + /** Static value Block for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction BLOCK = fromString("Block"); + + /** Static value Log for WebApplicationFirewallAction. */ + public static final WebApplicationFirewallAction LOG = fromString("Log"); + + /** + * Creates or finds a WebApplicationFirewallAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallAction. + */ + @JsonCreator + public static WebApplicationFirewallAction fromString(String name) { + return fromString(name, WebApplicationFirewallAction.class); + } + + /** @return known WebApplicationFirewallAction values. */ + public static Collection values() { + return values(WebApplicationFirewallAction.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java new file mode 100644 index 0000000000000..0e2aa260b55a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines contents of a web application rule. */ +@Fluent +public final class WebApplicationFirewallCustomRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallCustomRule.class); + + /* + * The name of the resource that is unique within a policy. This name can + * be used to access the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Priority of the rule. Rules with a lower value will be evaluated before + * rules with a higher value. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /* + * The rule type. + */ + @JsonProperty(value = "ruleType", required = true) + private WebApplicationFirewallRuleType ruleType; + + /* + * List of match conditions. + */ + @JsonProperty(value = "matchConditions", required = true) + private List matchConditions; + + /* + * Type of Actions. + */ + @JsonProperty(value = "action", required = true) + private WebApplicationFirewallAction action; + + /** + * Get the name property: The name of the resource that is unique within a policy. This name can be used to access + * the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource that is unique within a policy. This name can be used to access + * the resource. + * + * @param name the name value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a + * higher value. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the rule. Rules with a lower value will be evaluated before rules with a + * higher value. + * + * @param priority the priority value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the ruleType property: The rule type. + * + * @return the ruleType value. + */ + public WebApplicationFirewallRuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: The rule type. + * + * @param ruleType the ruleType value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRuleType(WebApplicationFirewallRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the matchConditions property: List of match conditions. + * + * @return the matchConditions value. + */ + public List matchConditions() { + return this.matchConditions; + } + + /** + * Set the matchConditions property: List of match conditions. + * + * @param matchConditions the matchConditions value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withMatchConditions(List matchConditions) { + this.matchConditions = matchConditions; + return this; + } + + /** + * Get the action property: Type of Actions. + * + * @return the action value. + */ + public WebApplicationFirewallAction action() { + return this.action; + } + + /** + * Set the action property: Type of Actions. + * + * @param action the action value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withAction(WebApplicationFirewallAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ruleType in model WebApplicationFirewallCustomRule")); + } + if (matchConditions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property matchConditions in model WebApplicationFirewallCustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (action() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property action in model WebApplicationFirewallCustomRule")); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java new file mode 100644 index 0000000000000..06243fd0d57f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallEnabledState. */ +public final class WebApplicationFirewallEnabledState extends ExpandableStringEnum { + /** Static value Disabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState DISABLED = fromString("Disabled"); + + /** Static value Enabled for WebApplicationFirewallEnabledState. */ + public static final WebApplicationFirewallEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a WebApplicationFirewallEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallEnabledState. + */ + @JsonCreator + public static WebApplicationFirewallEnabledState fromString(String name) { + return fromString(name, WebApplicationFirewallEnabledState.class); + } + + /** @return known WebApplicationFirewallEnabledState values. */ + public static Collection values() { + return values(WebApplicationFirewallEnabledState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java new file mode 100644 index 0000000000000..eae39bd306a32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallMatchVariable. */ +public final class WebApplicationFirewallMatchVariable + extends ExpandableStringEnum { + /** Static value RemoteAddr for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** Static value RequestMethod for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_METHOD = fromString("RequestMethod"); + + /** Static value QueryString for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable QUERY_STRING = fromString("QueryString"); + + /** Static value PostArgs for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable POST_ARGS = fromString("PostArgs"); + + /** Static value RequestUri for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_URI = fromString("RequestUri"); + + /** Static value RequestHeaders for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_HEADERS = fromString("RequestHeaders"); + + /** Static value RequestBody for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_BODY = fromString("RequestBody"); + + /** Static value RequestCookies for WebApplicationFirewallMatchVariable. */ + public static final WebApplicationFirewallMatchVariable REQUEST_COOKIES = fromString("RequestCookies"); + + /** + * Creates or finds a WebApplicationFirewallMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMatchVariable. + */ + @JsonCreator + public static WebApplicationFirewallMatchVariable fromString(String name) { + return fromString(name, WebApplicationFirewallMatchVariable.class); + } + + /** @return known WebApplicationFirewallMatchVariable values. */ + public static Collection values() { + return values(WebApplicationFirewallMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java new file mode 100644 index 0000000000000..076445aee3133 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallMode. */ +public final class WebApplicationFirewallMode extends ExpandableStringEnum { + /** Static value Prevention for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode PREVENTION = fromString("Prevention"); + + /** Static value Detection for WebApplicationFirewallMode. */ + public static final WebApplicationFirewallMode DETECTION = fromString("Detection"); + + /** + * Creates or finds a WebApplicationFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMode. + */ + @JsonCreator + public static WebApplicationFirewallMode fromString(String name) { + return fromString(name, WebApplicationFirewallMode.class); + } + + /** @return known WebApplicationFirewallMode values. */ + public static Collection values() { + return values(WebApplicationFirewallMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java new file mode 100644 index 0000000000000..f09ee001d67b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallOperator. */ +public final class WebApplicationFirewallOperator extends ExpandableStringEnum { + /** Static value IPMatch for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator IPMATCH = fromString("IPMatch"); + + /** Static value Equal for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator EQUAL = fromString("Equal"); + + /** Static value Contains for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator CONTAINS = fromString("Contains"); + + /** Static value LessThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN = fromString("LessThan"); + + /** Static value GreaterThan for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN = fromString("GreaterThan"); + + /** Static value LessThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator LESS_THAN_OR_EQUAL = fromString("LessThanOrEqual"); + + /** Static value GreaterThanOrEqual for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GREATER_THAN_OR_EQUAL = fromString("GreaterThanOrEqual"); + + /** Static value BeginsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator BEGINS_WITH = fromString("BeginsWith"); + + /** Static value EndsWith for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator ENDS_WITH = fromString("EndsWith"); + + /** Static value Regex for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator REGEX = fromString("Regex"); + + /** Static value GeoMatch for WebApplicationFirewallOperator. */ + public static final WebApplicationFirewallOperator GEO_MATCH = fromString("GeoMatch"); + + /** + * Creates or finds a WebApplicationFirewallOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallOperator. + */ + @JsonCreator + public static WebApplicationFirewallOperator fromString(String name) { + return fromString(name, WebApplicationFirewallOperator.class); + } + + /** @return known WebApplicationFirewallOperator values. */ + public static Collection values() { + return values(WebApplicationFirewallOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java new file mode 100644 index 0000000000000..450f3d00fdbc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WebApplicationFirewallPolicies. */ +public interface WebApplicationFirewallPolicies { + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all of the protection policies within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all the WAF policies in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the WAF policies in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the WAF policies in a subscription. + */ + PagedIterable list(Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy. + */ + WebApplicationFirewallPolicy getByResourceGroup(String resourceGroupName, String policyName); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String policyName, Context context); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String policyName); + + /** + * Deletes Policy. + * + * @param resourceGroupName The name of the resource group. + * @param policyName The name of the policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String policyName, Context context); + + /** + * Retrieve protection policy with specified name within a resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines web application firewall policy 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..86987a6b02a0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of WebApplicationFirewallPolicy. */ +public interface WebApplicationFirewallPolicy { + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the 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 inner com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner + * object. + * + * @return the inner object. + */ + WebApplicationFirewallPolicyInner innerModel(); + + /** The entirety of the WebApplicationFirewallPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The WebApplicationFirewallPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the WebApplicationFirewallPolicy definition. */ + interface Blank extends WithLocation { + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the WebApplicationFirewallPolicy definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithPolicySettings, + DefinitionStages.WithCustomRules, + DefinitionStages.WithManagedRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + WebApplicationFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WebApplicationFirewallPolicy create(Context context); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: The PolicySettings for policy.. + * + * @param policySettings The PolicySettings for policy. + * @return the next definition stage. + */ + WithCreate withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify customRules. */ + interface WithCustomRules { + /** + * Specifies the customRules property: The custom rules inside the policy.. + * + * @param customRules The custom rules inside the policy. + * @return the next definition stage. + */ + WithCreate withCustomRules(List customRules); + } + /** The stage of the WebApplicationFirewallPolicy definition allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes the managedRules structure.. + * + * @param managedRules Describes the managedRules structure. + * @return the next definition stage. + */ + WithCreate withManagedRules(ManagedRulesDefinition managedRules); + } + } + /** + * Begins update for the WebApplicationFirewallPolicy resource. + * + * @return the stage of resource update. + */ + WebApplicationFirewallPolicy.Update update(); + + /** The template for WebApplicationFirewallPolicy update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPolicySettings, + UpdateStages.WithCustomRules, + UpdateStages.WithManagedRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WebApplicationFirewallPolicy apply(Context context); + } + /** The WebApplicationFirewallPolicy update stages. */ + interface UpdateStages { + /** The stage of the WebApplicationFirewallPolicy update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify policySettings. */ + interface WithPolicySettings { + /** + * Specifies the policySettings property: The PolicySettings for policy.. + * + * @param policySettings The PolicySettings for policy. + * @return the next definition stage. + */ + Update withPolicySettings(PolicySettings policySettings); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify customRules. */ + interface WithCustomRules { + /** + * Specifies the customRules property: The custom rules inside the policy.. + * + * @param customRules The custom rules inside the policy. + * @return the next definition stage. + */ + Update withCustomRules(List customRules); + } + /** The stage of the WebApplicationFirewallPolicy update allowing to specify managedRules. */ + interface WithManagedRules { + /** + * Specifies the managedRules property: Describes the managedRules structure.. + * + * @param managedRules Describes the managedRules structure. + * @return the next definition stage. + */ + Update withManagedRules(ManagedRulesDefinition managedRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WebApplicationFirewallPolicy refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java new file mode 100644 index 0000000000000..4c4bf8190b517 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list WebApplicationFirewallPolicies. It contains a list of WebApplicationFirewallPolicy + * objects and a URL link to get the next set of results. + */ +@Immutable +public final class WebApplicationFirewallPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WebApplicationFirewallPolicyListResult.class); + + /* + * List of WebApplicationFirewallPolicies within a resource group. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there + * are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of WebApplicationFirewallPolicies within a resource group. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java new file mode 100644 index 0000000000000..d0cae19ce1e0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallPolicyResourceState. */ +public final class WebApplicationFirewallPolicyResourceState + extends ExpandableStringEnum { + /** Static value Creating for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState CREATING = fromString("Creating"); + + /** Static value Enabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLING = fromString("Enabling"); + + /** Static value Enabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState ENABLED = fromString("Enabled"); + + /** Static value Disabling for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLING = fromString("Disabling"); + + /** Static value Disabled for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DISABLED = fromString("Disabled"); + + /** Static value Deleting for WebApplicationFirewallPolicyResourceState. */ + public static final WebApplicationFirewallPolicyResourceState DELETING = fromString("Deleting"); + + /** + * Creates or finds a WebApplicationFirewallPolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallPolicyResourceState. + */ + @JsonCreator + public static WebApplicationFirewallPolicyResourceState fromString(String name) { + return fromString(name, WebApplicationFirewallPolicyResourceState.class); + } + + /** @return known WebApplicationFirewallPolicyResourceState values. */ + public static Collection values() { + return values(WebApplicationFirewallPolicyResourceState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java new file mode 100644 index 0000000000000..40d8736448b09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallRuleType. */ +public final class WebApplicationFirewallRuleType extends ExpandableStringEnum { + /** Static value MatchRule for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType MATCH_RULE = fromString("MatchRule"); + + /** Static value Invalid for WebApplicationFirewallRuleType. */ + public static final WebApplicationFirewallRuleType INVALID = fromString("Invalid"); + + /** + * Creates or finds a WebApplicationFirewallRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallRuleType. + */ + @JsonCreator + public static WebApplicationFirewallRuleType fromString(String name) { + return fromString(name, WebApplicationFirewallRuleType.class); + } + + /** @return known WebApplicationFirewallRuleType values. */ + public static Collection values() { + return values(WebApplicationFirewallRuleType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java new file mode 100644 index 0000000000000..e8e38d5d9dd19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebApplicationFirewallTransform. */ +public final class WebApplicationFirewallTransform extends ExpandableStringEnum { + /** Static value Lowercase for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform LOWERCASE = fromString("Lowercase"); + + /** Static value Trim for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform TRIM = fromString("Trim"); + + /** Static value UrlDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_DECODE = fromString("UrlDecode"); + + /** Static value UrlEncode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform URL_ENCODE = fromString("UrlEncode"); + + /** Static value RemoveNulls for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform REMOVE_NULLS = fromString("RemoveNulls"); + + /** Static value HtmlEntityDecode for WebApplicationFirewallTransform. */ + public static final WebApplicationFirewallTransform HTML_ENTITY_DECODE = fromString("HtmlEntityDecode"); + + /** + * Creates or finds a WebApplicationFirewallTransform from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallTransform. + */ + @JsonCreator + public static WebApplicationFirewallTransform fromString(String name) { + return fromString(name, WebApplicationFirewallTransform.class); + } + + /** @return known WebApplicationFirewallTransform values. */ + public static Collection values() { + return values(WebApplicationFirewallTransform.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java new file mode 100644 index 0000000000000..7238825a6c6d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WebCategories. */ +public interface WebCategories { + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category. + */ + AzureWebCategory get(String name); + + /** + * Gets the specified Azure Web Category. + * + * @param name The name of the azureWebCategory. + * @param expand Expands resourceIds back referenced by the azureWebCategory resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Web Category along with {@link Response}. + */ + Response getWithResponse(String name, String expand, Context context); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Azure Web Categories in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Azure Web Categories in a subscription. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java new file mode 100644 index 0000000000000..4b076d6d32e46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated.models; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java new file mode 100644 index 0000000000000..adbbe4531ffac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for NetworkManagementClient. Network Client. */ +package com.azure.resourcemanager.network.generated; diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ffb4499d26afb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.network.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.network.generated; + exports com.azure.resourcemanager.network.generated.fluent; + exports com.azure.resourcemanager.network.generated.fluent.models; + exports com.azure.resourcemanager.network.generated.models; + + opens com.azure.resourcemanager.network.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.network.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/network/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..943b1e96904b3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections Delete. */ +public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9c675ea62aa6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections Get. */ +public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c66cbf449a9fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateEndpointConnections List. */ +public final class ApplicationGatewayPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7b0df707363ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.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.util.Context; +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/2021-08-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.")), + 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..ad61148b0d0f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGatewayPrivateLinkResources List. */ +public final class ApplicationGatewayPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..717a49f924cca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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/2021-08-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, + 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..fb38733e56fdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways BackendHealth. */ +public final class ApplicationGatewaysBackendHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..38cda9d21e281 --- /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/2021-08-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("https://kv/secret"))) + .withTrustedClientCertificates( + Arrays.asList(new ApplicationGatewayTrustedClientCertificate().withName("clientcert").withData("****"))) + .withSslCertificates( + Arrays + .asList( + new ApplicationGatewaySslCertificate() + .withName("sslcert") + .withData("****") + .withPassword("****"), + new ApplicationGatewaySslCertificate() + .withName("sslcert2") + .withKeyVaultSecretId("https://kv/secret"))) + .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..0eacb2ad872b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Delete. */ +public final class ApplicationGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5ae0a279583d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways GetByResourceGroup. */ +public final class ApplicationGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9aefb8a6a4f7d --- /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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways GetSslPredefinedPolicy. */ +public final class ApplicationGatewaysGetSslPredefinedPolicySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..769509c9fe1b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableRequestHeaders. */ +public final class ApplicationGatewaysListAvailableRequestHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..4cc0afba149c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableResponseHeaders. */ +public final class ApplicationGatewaysListAvailableResponseHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..3cf62f3b9816a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableServerVariables. */ +public final class ApplicationGatewaysListAvailableServerVariablesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..0b61681bb442c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableSslOptions. */ +public final class ApplicationGatewaysListAvailableSslOptionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..1bfa6b610e896 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. */ +public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..2e07ff3636e09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListAvailableWafRuleSets. */ +public final class ApplicationGatewaysListAvailableWafRuleSetsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..41498352e6872 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways ListByResourceGroup. */ +public final class ApplicationGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c4cbe834a819e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways List. */ +public final class ApplicationGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..9cb6537d56b9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Start. */ +public final class ApplicationGatewaysStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..03d9b9cf18c0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationGateways Stop. */ +public final class ApplicationGatewaysStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0495e0b041939 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..aa7de8324c2b8 --- /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/2021-08-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..514fbeac85b59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups Delete. */ +public final class ApplicationSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9e5d89a4169cc --- /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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups GetByResourceGroup. */ +public final class ApplicationSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7cc53b507370f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups ListByResourceGroup. */ +public final class ApplicationSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..54123db891ed3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApplicationSecurityGroups List. */ +public final class ApplicationSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..d9c6d6a164ace --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..06ff6684410d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailableDelegations List. */ +public final class AvailableDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..fd0baddcc10a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailableEndpointServices List. */ +public final class AvailableEndpointServicesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7cded11deb454 --- /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; + +import com.azure.core.util.Context; + +/** Samples for AvailablePrivateEndpointTypes ListByResourceGroup. */ +public final class AvailablePrivateEndpointTypesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..81afa12cc582a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailablePrivateEndpointTypes List. */ +public final class AvailablePrivateEndpointTypesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ac5419b1ae831 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailableResourceGroupDelegations List. */ +public final class AvailableResourceGroupDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1dd4de8b66f29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailableServiceAliases ListByResourceGroup. */ +public final class AvailableServiceAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8bf48828f21cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AvailableServiceAliases List. */ +public final class AvailableServiceAliasesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..779d7313b3bf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AzureFirewallFqdnTags List. */ +public final class AzureFirewallFqdnTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..8a4359a2ff540 --- /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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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..853fba4c58ae1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls Delete. */ +public final class AzureFirewallsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..996b90a582d69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.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.util.Context; + +/** Samples for AzureFirewalls GetByResourceGroup. */ +public final class AzureFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7dac9d174d867 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls ListByResourceGroup. */ +public final class AzureFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..46cb6599fcc4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for AzureFirewalls List. */ +public final class AzureFirewallsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..03880fe1106cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..87a03e7e11d4c --- /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/2021-08-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..b6f9c18b5e206 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts Delete. */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..eed24f3df4279 --- /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; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts GetByResourceGroup. */ +public final class BastionHostsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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'", 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..67d6aa46581a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts ListByResourceGroup. */ +public final class BastionHostsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f140760d07b01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BastionHosts List. */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..71685986b03f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..46fbd66dbd111 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BgpServiceCommunities List. */ +public final class BgpServiceCommunitiesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..d2cb9c540ebcb --- /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/2021-08-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/2021-08-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..48700ef80f5b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Delete. */ +public final class ConnectionMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f91339d0ba4e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Get. */ +public final class ConnectionMonitorsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1035c340492c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors List. */ +public final class ConnectionMonitorsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7449909766c92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Query. */ +public final class ConnectionMonitorsQuerySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..148cf0cad8a31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Start. */ +public final class ConnectionMonitorsStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7e5b5fa0e88af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitors Stop. */ +public final class ConnectionMonitorsStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b14cda679cf74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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/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..caa1ec34d2e94 --- /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/2021-08-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..379136b714d25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes Delete. */ +public final class CustomIpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b35ced4c5e3e4 --- /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; + +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes GetByResourceGroup. */ +public final class CustomIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..b3fdc4b04cbfd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes ListByResourceGroup. */ +public final class CustomIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..70960835c9b96 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for CustomIpPrefixes List. */ +public final class CustomIpPrefixesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..34960d23e7eb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..ed9dcb2ee81d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.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.DdosCustomPolicyProtocol; +import com.azure.resourcemanager.network.generated.models.ProtocolCustomSettingsFormat; +import java.util.Arrays; + +/** Samples for DdosCustomPolicies CreateOrUpdate. */ +public final class DdosCustomPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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") + .withProtocolCustomSettings( + Arrays.asList(new ProtocolCustomSettingsFormat().withProtocol(DdosCustomPolicyProtocol.TCP))) + .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..297a91d478802 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DdosCustomPolicies Delete. */ +public final class DdosCustomPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a2b5fcc521970 --- /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; + +import com.azure.core.util.Context; + +/** Samples for DdosCustomPolicies GetByResourceGroup. */ +public final class DdosCustomPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..43b73d012993a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..f01bdde66b0c0 --- /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/2021-08-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..bf36e9e0215b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans Delete. */ +public final class DdosProtectionPlansDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9e9a2c8cd33fa --- /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; + +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans GetByResourceGroup. */ +public final class DdosProtectionPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..90fccda2b4f18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans ListByResourceGroup. */ +public final class DdosProtectionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d4f177a21f9b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DdosProtectionPlans List. */ +public final class DdosProtectionPlansListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..08d2ac674a3a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..6ed232404a798 --- /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; + +import com.azure.core.util.Context; + +/** Samples for DefaultSecurityRules Get. */ +public final class DefaultSecurityRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..69048a9ace8ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DefaultSecurityRules List. */ +public final class DefaultSecurityRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4ecab4b779e8f --- /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/2021-08-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..f64ada78224ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration Delete. */ +public final class DscpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..26884cee51ed0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration GetByResourceGroup. */ +public final class DscpConfigurationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b84e634a9e5b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration ListByResourceGroup. */ +public final class DscpConfigurationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1e35072dab9bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DscpConfiguration List. */ +public final class DscpConfigurationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..a575929c53d3c --- /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/2021-08-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..79e2a23bd238f --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations Delete. */ +public final class ExpressRouteCircuitAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..57b6418d6e4d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations Get. */ +public final class ExpressRouteCircuitAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..014e27a640e3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitAuthorizations List. */ +public final class ExpressRouteCircuitAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5b285d1b51e59 --- /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/2021-08-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..02ccf5876730b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.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.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections Delete. */ +public final class ExpressRouteCircuitConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0e8f739ba0f5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections Get. */ +public final class ExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..707bdd0839a9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitConnections List. */ +public final class ExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..567dd6a2c250e --- /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/2021-08-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..03c0c23d42aa2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings Delete. */ +public final class ExpressRouteCircuitPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..526570352f63b --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings Get. */ +public final class ExpressRouteCircuitPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..89842387704f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuitPeerings List. */ +public final class ExpressRouteCircuitPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..21d2b6ad7597c --- /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/2021-08-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/2021-08-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..f71c79b5912fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits Delete. */ +public final class ExpressRouteCircuitsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..38d96728e1948 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetByResourceGroup. */ +public final class ExpressRouteCircuitsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ae4f0591dbeca --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetPeeringStats. */ +public final class ExpressRouteCircuitsGetPeeringStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..285cda03b09e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits GetStats. */ +public final class ExpressRouteCircuitsGetStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c6948d7bb17b3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListArpTable. */ +public final class ExpressRouteCircuitsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..41d6867971ebe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListByResourceGroup. */ +public final class ExpressRouteCircuitsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..25f5be183e127 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits ListRoutesTable. */ +public final class ExpressRouteCircuitsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e8111eb5b0a19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.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.core.util.Context; + +/** Samples for ExpressRouteCircuits ListRoutesTableSummary. */ +public final class ExpressRouteCircuitsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..811ea987a01cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCircuits List. */ +public final class ExpressRouteCircuitsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..55dd224e8a256 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..a0cc1e4284ebb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.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.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; + +/** Samples for ExpressRouteConnections CreateOrUpdate. */ +public final class ExpressRouteConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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("authorizationKey") + .withRoutingWeight(2), + 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..7f28dcc33e5a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.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.core.util.Context; + +/** Samples for ExpressRouteConnections Delete. */ +public final class ExpressRouteConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2167e9316e91c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.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.core.util.Context; + +/** Samples for ExpressRouteConnections Get. */ +public final class ExpressRouteConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..21d9757bfd4af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.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.core.util.Context; + +/** Samples for ExpressRouteConnections List. */ +public final class ExpressRouteConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ba5cd1f3cf570 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.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.core.util.Context; +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/2021-08-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")), + 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..a2be4c1e29053 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.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.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings Delete. */ +public final class ExpressRouteCrossConnectionPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4ec8fcd702abe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings Get. */ +public final class ExpressRouteCrossConnectionPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..964c37ea1153d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnectionPeerings List. */ +public final class ExpressRouteCrossConnectionPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", "", 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..dd2e20aac499d --- /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/2021-08-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..0dffeb23bd777 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for ExpressRouteCrossConnections GetByResourceGroup. */ +public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", "", 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..ea50b05dfaf3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListArpTable. */ +public final class ExpressRouteCrossConnectionsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d2b4492f84a4e --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListByResourceGroup. */ +public final class ExpressRouteCrossConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..609a909506e65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListRoutesTable. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4479cc76607ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections ListRoutesTableSummary. */ +public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d9895ad6bf638 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteCrossConnections List. */ +public final class ExpressRouteCrossConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..a78074c00979c --- /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.core.util.Context; +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/2021-08-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", "", 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..dcdf6aacd1540 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysCreateOrUpdateSamples.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.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/2021-08-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")) + .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..4db70e9d21e80 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways Delete. */ +public final class ExpressRouteGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..779f6e060bceb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for ExpressRouteGateways GetByResourceGroup. */ +public final class ExpressRouteGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1f393be486775 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways ListByResourceGroup. */ +public final class ExpressRouteGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c680cc83ab61d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteGateways ListBySubscription. */ +public final class ExpressRouteGatewaysListBySubscriptionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..6048f8453f65b --- /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.core.util.Context; +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/2021-08-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", 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..cea2fc2db76cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteLinks Get. */ +public final class ExpressRouteLinksGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..26b123f51255e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteLinks List. */ +public final class ExpressRouteLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2b09891362b1e --- /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/2021-08-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..58d0757ef89e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations Delete. */ +public final class ExpressRoutePortAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..cac532c119a2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations Get. */ +public final class ExpressRoutePortAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..6b5ee1d018e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortAuthorizations List. */ +public final class ExpressRoutePortAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b213b532d856a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.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.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +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/2021-08-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))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .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..aa565436fd253 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts Delete. */ +public final class ExpressRoutePortsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..70cb68f5fc75d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), + 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..5245da45f6233 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts GetByResourceGroup. */ +public final class ExpressRoutePortsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f8fac75dc653c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts ListByResourceGroup. */ +public final class ExpressRoutePortsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a320c3fe0566a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePorts List. */ +public final class ExpressRoutePortsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..ee71a1c613031 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortsLocations Get. */ +public final class ExpressRoutePortsLocationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..647038a8e7ebe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRoutePortsLocations List. */ +public final class ExpressRoutePortsLocationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..f500b0c3492de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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/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..1522f6610dcda --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ExpressRouteServiceProviders List. */ +public final class ExpressRouteServiceProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..e5dfd5da50c84 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.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.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.ExplicitProxySettings; +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/2021-08-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)) + .withExplicitProxySettings( + new ExplicitProxySettings() + .withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .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("https://kv/secret") + .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..2cdf5ff9d0ed7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies Delete. */ +public final class FirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2163ad34ff5c4 --- /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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies GetByResourceGroup. */ +public final class FirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..142f400c65c4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies ListByResourceGroup. */ +public final class FirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..3cefe2622f8d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicies List. */ +public final class FirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java new file mode 100644 index 0000000000000..b0dcf681150d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.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.core.util.Context; +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/2021-08-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"), + 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..62e7cecc0cd85 --- /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.core.util.Context; +import com.azure.resourcemanager.network.generated.models.FilterItems; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import com.azure.resourcemanager.network.generated.models.OrderBy; +import com.azure.resourcemanager.network.generated.models.OrderByOrder; +import java.util.Arrays; + +/** Samples for FirewallPolicyIdpsSignatures List. */ +public final class FirewallPolicyIdpsSignaturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(OrderByOrder.ASCENDING)) + .withResultsPerPage(20) + .withSkip(0), + 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..caaf887af97c7 --- /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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyIdpsSignaturesOverrides Get. */ +public final class FirewallPolicyIdpsSignaturesOverridesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..067293ec13bdd --- /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; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyIdpsSignaturesOverrides List. */ +public final class FirewallPolicyIdpsSignaturesOverridesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..40289bb52d332 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.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.core.util.Context; +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/2021-08-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"))), + 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..e0ea10277239a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.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.core.util.Context; +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/2021-08-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"))), + 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..707a48246c3e4 --- /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/2021-08-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/2021-08-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/2021-08-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/2021-08-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..b2fc4c6161352 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups Delete. */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..3bb78553ea570 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups Get. */ +public final class FirewallPolicyRuleCollectionGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..709e33c4f56fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.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.core.util.Context; + +/** Samples for FirewallPolicyRuleCollectionGroups List. */ +public final class FirewallPolicyRuleCollectionGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a87403ae33cf8 --- /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/2021-08-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..ee439094d4a8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FlowLogs Delete. */ +public final class FlowLogsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..879db98e8ed9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FlowLogs Get. */ +public final class FlowLogsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ab415468350de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for FlowLogs List. */ +public final class FlowLogsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..05928114c5c3f --- /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.core.util.Context; +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/2021-08-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", 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..f1bf781bb71ba --- /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/2021-08-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..ae77f9dd3d5ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for HubRouteTables Delete. */ +public final class HubRouteTablesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8817b7f2e22a0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for HubRouteTables Get. */ +public final class HubRouteTablesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a0d0305fc6268 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for HubRouteTables List. */ +public final class HubRouteTablesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2144603e2f585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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.VnetRoute; +import java.util.Arrays; + +/** Samples for HubVirtualNetworkConnections CreateOrUpdate. */ +public final class HubVirtualNetworkConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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() + .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"))))), + 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..5b928f784236e --- /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; + +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections Delete. */ +public final class HubVirtualNetworkConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ed16cbb08fef2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections Get. */ +public final class HubVirtualNetworkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..abb9852650a00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for HubVirtualNetworkConnections List. */ +public final class HubVirtualNetworkConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8c1bc4047de82 --- /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/2021-08-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..9679ba848cd7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for InboundNatRules Delete. */ +public final class InboundNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ac374567af6bf --- /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; + +import com.azure.core.util.Context; + +/** Samples for InboundNatRules Get. */ +public final class InboundNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..d4c31116e06f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for InboundNatRules List. */ +public final class InboundNatRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1c0e3c248c799 --- /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/2021-08-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..ea5d987f9f8cf --- /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/2021-08-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..b044a7fdde109 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpAllocations Delete. */ +public final class IpAllocationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c5fddb01fce07 --- /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; + +import com.azure.core.util.Context; + +/** Samples for IpAllocations GetByResourceGroup. */ +public final class IpAllocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..43a30c4dea49c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpAllocations ListByResourceGroup. */ +public final class IpAllocationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..666bef866bc3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpAllocations List. */ +public final class IpAllocationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..7f28b8e472c58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..fe24dcb84d2db --- /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/2021-08-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..29466b4749ae7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpGroups Delete. */ +public final class IpGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..cc0bfaff13d44 --- /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; + +import com.azure.core.util.Context; + +/** Samples for IpGroups GetByResourceGroup. */ +public final class IpGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..9475ca5bd025b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpGroups ListByResourceGroup. */ +public final class IpGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9f7e1190668ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for IpGroups List. */ +public final class IpGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..ccab8af6d9d16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.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.core.util.Context; +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/2021-08-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, 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..a43ecd33c5156 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.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.core.management.SubResource; +import com.azure.core.util.Context; +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/2021-08-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", 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..03fe849a2170d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools Delete. */ +public final class LoadBalancerBackendAddressPoolsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a7373571a6e39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.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.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools Get. */ +public final class LoadBalancerBackendAddressPoolsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f23a37280a80c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.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.core.util.Context; + +/** Samples for LoadBalancerBackendAddressPools List. */ +public final class LoadBalancerBackendAddressPoolsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ccce812b3281d --- /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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerFrontendIpConfigurations Get. */ +public final class LoadBalancerFrontendIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..45be03baeecbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerFrontendIpConfigurations List. */ +public final class LoadBalancerFrontendIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..09267f2f86aba --- /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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerLoadBalancingRules Get. */ +public final class LoadBalancerLoadBalancingRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ba2bed7f02fa8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerLoadBalancingRules List. */ +public final class LoadBalancerLoadBalancingRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..6e340da7a813a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.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.core.util.Context; + +/** Samples for LoadBalancerNetworkInterfaces List. */ +public final class LoadBalancerNetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c473603becdd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerOutboundRules Get. */ +public final class LoadBalancerOutboundRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..92b7aa1a07398 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerOutboundRules List. */ +public final class LoadBalancerOutboundRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d05448dabd879 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerProbes Get. */ +public final class LoadBalancerProbesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ae9cb1ad6908e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancerProbes List. */ +public final class LoadBalancerProbesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..240505fb21213 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java @@ -0,0 +1,729 @@ +// Copyright (c) Microsoft Corporation. All rights 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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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/2021-08-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) + .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/2021-08-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) + .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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .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/2021-08-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) + .withRequestPath("healthcheck.aspx"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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) + .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/2021-08-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) + .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..be8b627a27368 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancers Delete. */ +public final class LoadBalancersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0ec19190bffcd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for LoadBalancers GetByResourceGroup. */ +public final class LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..55c81f41235af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancers ListByResourceGroup. */ +public final class LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..3de732952411d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.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.core.util.Context; +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/2021-08-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"), + 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..532a9ac0ede42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LoadBalancers List. */ +public final class LoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..f40f2576096c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.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.core.management.SubResource; +import com.azure.core.util.Context; +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/2021-08-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")))), + 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..62328a0a7ad7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..891923068ada0 --- /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/2021-08-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..2f06e5bf8ed79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways Delete. */ +public final class LocalNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..317b7dca4dcb3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways GetByResourceGroup. */ +public final class LocalNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..14d014d6c4db4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for LocalNetworkGateways ListByResourceGroup. */ +public final class LocalNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2a11f06f18879 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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/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..148034cf45ee3 --- /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/2021-08-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..1d6c655f60074 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatGateways Delete. */ +public final class NatGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..756779f56e490 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NatGateways GetByResourceGroup. */ +public final class NatGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..725e5a9f676e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatGateways ListByResourceGroup. */ +public final class NatGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..59a6f7cde9269 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatGateways List. */ +public final class NatGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..811b61012c47e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..152e3e7453a91 --- /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/2021-08-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..85cfa2c83dab7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatRules Delete. */ +public final class NatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7bf07e3b9a601 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatRules Get. */ +public final class NatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c68472ed83d8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.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; + +import com.azure.core.util.Context; + +/** Samples for NatRules ListByVpnGateway. */ +public final class NatRulesListByVpnGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..34cb4478b1e97 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceIpConfigurations Get. */ +public final class NetworkInterfaceIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..33df788f0d0fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceIpConfigurations List. */ +public final class NetworkInterfaceIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..50a81263995bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceLoadBalancers List. */ +public final class NetworkInterfaceLoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..cd14b2a9a4ef6 --- /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/2021-08-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..aff975a6d8c29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations Delete. */ +public final class NetworkInterfaceTapConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..154aafc9c1bc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations Get. */ +public final class NetworkInterfaceTapConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..02077fa2ba5d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaceTapConfigurations List. */ +public final class NetworkInterfaceTapConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..51b20c39c473a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.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; + +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/2021-08-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/2021-08-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) + .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..c2310a0a9d62e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces Delete. */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5f386f06c014c --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetByResourceGroup. */ +public final class NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..82f149948830d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.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.core.util.Context; + +/** Samples for NetworkInterfaces GetCloudServiceNetworkInterface. */ +public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..4127355c525ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetEffectiveRouteTable. */ +public final class NetworkInterfacesGetEffectiveRouteTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..061f941c42a46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces GetVirtualMachineScaleSetIpConfiguration. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..53678225eb537 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.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.core.util.Context; + +/** Samples for NetworkInterfaces GetVirtualMachineScaleSetNetworkInterface. */ +public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..8999c3c626ca2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListByResourceGroup. */ +public final class NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..74eb4db25c22f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e4fa8d0cc03d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.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.core.util.Context; + +/** Samples for NetworkInterfaces ListCloudServiceRoleInstanceNetworkInterfaces. */ +public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b44495cf62cb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. */ +public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..04b0689480c85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces List. */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..67cfe1961fa67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.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.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetIpConfigurations. */ +public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..aec16289a8c12 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0dce1012779e3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkInterfaces ListVirtualMachineScaleSetVMNetworkInterfaces. */ +public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8b707ea2a13df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..b2f6134212591 --- /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/2021-08-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..c044a8ab59418 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles Delete. */ +public final class NetworkProfilesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..abb8ddbe5f9dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for NetworkProfiles GetByResourceGroup. */ +public final class NetworkProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..a527c42d198fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles ListByResourceGroup. */ +public final class NetworkProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..88dc3f29d4168 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkProfiles List. */ +public final class NetworkProfilesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..7709c3ace6f82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..71668d5a5f086 --- /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/2021-08-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/2021-08-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..14057010461d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups Delete. */ +public final class NetworkSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f558ef305ece0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups GetByResourceGroup. */ +public final class NetworkSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..6f0c5f903cf92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups ListByResourceGroup. */ +public final class NetworkSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..03b7ca1184185 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkSecurityGroups List. */ +public final class NetworkSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..986bcaf6966fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.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.util.Context; +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/2021-08-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, 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..e36e394f96c53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.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/2021-08-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..07163645518ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances Delete. */ +public final class NetworkVirtualAppliancesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9de2ae776ee43 --- /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; + +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances GetByResourceGroup. */ +public final class NetworkVirtualAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..a977eb2f5bd51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances ListByResourceGroup. */ +public final class NetworkVirtualAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a0cf9f4392454 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkVirtualAppliances List. */ +public final class NetworkVirtualAppliancesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..c6f6647639007 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.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.util.Context; +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/2021-08-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, 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..f1f6037282283 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.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.core.util.Context; +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/2021-08-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), + 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..9e1919e5ded47 --- /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/2021-08-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..cd7303b628333 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers Delete. */ +public final class NetworkWatchersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..df7ebc0d2a6dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetAzureReachabilityReportSamples.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.core.util.Context; +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/2021-08-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")), + 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..bc1d07f3e52ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers GetByResourceGroup. */ +public final class NetworkWatchersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2067889bdaf38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.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.core.util.Context; +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/2021-08-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"), + 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..00915989e94cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"))), + 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..094a62791127b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNextHopSamples.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.core.util.Context; +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/2021-08-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"), + 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..517752d496dab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTopologySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), 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..42c9eb524c982 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.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.core.util.Context; +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/2021-08-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"), + 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..dbddc4a7f9ada --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), + 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..0f62f8c972b5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.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.core.util.Context; +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/2021-08-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"), + 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..3f9dcce6e066a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.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.core.util.Context; +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/2021-08-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"), + 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..bedd1d328df9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers ListByResourceGroup. */ +public final class NetworkWatchersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..efaa1383419b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for NetworkWatchers List. */ +public final class NetworkWatchersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..11caa513e56d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.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.core.util.Context; +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/2021-08-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), + 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..4911ddceda661 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..dc9a2de4530a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), + 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..85630cdff15d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..63be1dfbca75e --- /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/2021-08-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..ad92977111f52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways Delete. */ +public final class P2SVpnGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..6daa7bd68807c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples.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.core.util.Context; +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/2021-08-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")), + 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..cda1d765434ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGenerateVpnProfileSamples.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.core.util.Context; +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/2021-08-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), + 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..0ce6d08102b38 --- /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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways GetByResourceGroup. */ +public final class P2SVpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..3ee68b876894d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.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.core.util.Context; +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/2021-08-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"), + 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..106a3035f1018 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways GetP2SVpnConnectionHealth. */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..56e4dc3f4f733 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways ListByResourceGroup. */ +public final class P2SVpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b9260be37be51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways List. */ +public final class P2SVpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..24571f501deb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for P2SVpnGateways Reset. */ +public final class P2SVpnGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b9e63a21664cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..91ee03581cc5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.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.core.util.Context; +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/2021-08-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"))), + 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..173194c41a9b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Delete. */ +public final class PacketCapturesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bf6b90cae6a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Get. */ +public final class PacketCapturesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..79ae1b38e9c42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PacketCaptures GetStatus. */ +public final class PacketCapturesGetStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..fe3659e7d23c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PacketCaptures List. */ +public final class PacketCapturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..89514a203f995 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PacketCaptures Stop. */ +public final class PacketCapturesStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..61a079eeadafa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.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.core.util.Context; + +/** Samples for PeerExpressRouteCircuitConnections Get. */ +public final class PeerExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", + 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..baaacab1cb8fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PeerExpressRouteCircuitConnections List. */ +public final class PeerExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f931a602911e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.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.core.util.Context; +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/2021-08-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"))), + 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..863b7e67d2d5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups Delete. */ +public final class PrivateDnsZoneGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..16f47b1f6dbbb --- /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; + +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups Get. */ +public final class PrivateDnsZoneGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..14ac366b26a33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateDnsZoneGroups List. */ +public final class PrivateDnsZoneGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..54689c3049b88 --- /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/2021-08-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/2021-08-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/2021-08-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..fe1969749be20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints Delete. */ +public final class PrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..254c618a0e2c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.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.util.Context; + +/** Samples for PrivateEndpoints GetByResourceGroup. */ +public final class PrivateEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..7d99c743c5ed4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints ListByResourceGroup. */ +public final class PrivateEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..960bca18ccf5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpoints List. */ +public final class PrivateEndpointsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..1f5925dc4a239 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples.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.core.util.Context; +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/2021-08-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"), + 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..bfaf68687516b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), + 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..d36b40f7d4cbc --- /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/2021-08-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..f10fc1f9fa932 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices DeletePrivateEndpointConnection. */ +public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..772268358f065 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices Delete. */ +public final class PrivateLinkServicesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d2b46a2239097 --- /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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices GetByResourceGroup. */ +public final class PrivateLinkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..bede53bbef109 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.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.core.util.Context; + +/** Samples for PrivateLinkServices GetPrivateEndpointConnection. */ +public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..7deaa6fad00d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServicesByResourceGroup. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2127dd5fe033c --- /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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServices. */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2d54216780426 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListByResourceGroup. */ +public final class PrivateLinkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b45d0c60d2c3b --- /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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices ListPrivateEndpointConnections. */ +public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..23f069fa2bb8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkServices List. */ +public final class PrivateLinkServicesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..5e8ab2d49a773 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.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.util.Context; +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/2021-08-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.")), + 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..462db8d4ededb --- /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/2021-08-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/2021-08-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/2021-08-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/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..b8ed629ba8610 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses Delete. */ +public final class PublicIpAddressesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..128cd0f2d5010 --- /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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetByResourceGroup. */ +public final class PublicIpAddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..1941b7b0398a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetCloudServicePublicIpAddress. */ +public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..716854b3bb99b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses GetVirtualMachineScaleSetPublicIpAddress. */ +public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..32249014d34ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListByResourceGroup. */ +public final class PublicIpAddressesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f843f4102b8ec --- /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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListCloudServicePublicIpAddresses. */ +public final class PublicIpAddressesListCloudServicePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..659025f901e34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListCloudServiceRoleInstancePublicIpAddresses. */ +public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..dda9852d3987b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses List. */ +public final class PublicIpAddressesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..8469efa7bb75f --- /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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpAddresses ListVirtualMachineScaleSetPublicIpAddresses. */ +public final class PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0bed55bad5a65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.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.core.util.Context; + +/** Samples for PublicIpAddresses ListVirtualMachineScaleSetVMPublicIpAddresses. */ +public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4259c6e7480a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..4c22d494e5759 --- /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/2021-08-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/2021-08-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..60e4b5933d05e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes Delete. */ +public final class PublicIpPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1356d7fa3a834 --- /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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes GetByResourceGroup. */ +public final class PublicIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..a315f2bf57a46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes ListByResourceGroup. */ +public final class PublicIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9af93b6355e32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for PublicIpPrefixes List. */ +public final class PublicIpPrefixesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..13357dc5c3abe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..4f3ee5c317ce2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ResourceNavigationLinks List. */ +public final class ResourceNavigationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..14b1a670cbfb7 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider CheckDnsNameAvailability. */ +public final class ResourceProviderCheckDnsNameAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ee7c280fed529 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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")))), + 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..0d52c28b8d415 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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(), 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..f9a474a564779 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.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.core.util.Context; +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/2021-08-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), + 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..e6cbbe9336ba0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider GetActiveSessions. */ +public final class ResourceProviderGetActiveSessionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4941d66ad0734 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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")))), + 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..3b4be8a0052bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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")))), + 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..310be7a195d8e --- /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; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SupportedSecurityProviders. */ +public final class ResourceProviderSupportedSecurityProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7442c8d5322ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.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.core.util.Context; +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/2021-08-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")), + 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..b2dd4eadcf9c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules Delete. */ +public final class RouteFilterRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..277367f691994 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules Get. */ +public final class RouteFilterRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b868f08bd9a7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilterRules ListByRouteFilter. */ +public final class RouteFilterRulesListByRouteFilterSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d4330070c2c19 --- /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/2021-08-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..a939d67ea5791 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilters Delete. */ +public final class RouteFiltersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..baa95c282d5e5 --- /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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilters GetByResourceGroup. */ +public final class RouteFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..f2a6e9149c182 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilters ListByResourceGroup. */ +public final class RouteFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..26ffb156af5e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteFilters List. */ +public final class RouteFiltersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..541070706f259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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/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..08f6aadc3cf39 --- /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/2021-08-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/2021-08-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..eeba2b207ad23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteTables Delete. */ +public final class RouteTablesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..aa5ceff96715f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteTables GetByResourceGroup. */ +public final class RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..9e00d02b67799 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteTables ListByResourceGroup. */ +public final class RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8077379b34ed7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RouteTables List. */ +public final class RouteTablesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..04c0f61ee6b33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..4ef9a2c788105 --- /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/2021-08-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..d40660790a4bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Routes Delete. */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a8978e4797b59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Routes Get. */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4bb2a50d10c29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Routes List. */ +public final class RoutesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..cc00792a5208d --- /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/2021-08-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..1f23ebd685d95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RoutingIntent Delete. */ +public final class RoutingIntentDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f1fee5d66520a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RoutingIntent Get. */ +public final class RoutingIntentGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8fd320c824a16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RoutingIntent List. */ +public final class RoutingIntentListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bd99b80396c67 --- /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/2021-08-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..4c94d0748f327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders Delete. */ +public final class SecurityPartnerProvidersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9fd9977a9ce02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for SecurityPartnerProviders GetByResourceGroup. */ +public final class SecurityPartnerProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..6473dc59e1f7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders ListByResourceGroup. */ +public final class SecurityPartnerProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5deef928d7e58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityPartnerProviders List. */ +public final class SecurityPartnerProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..c9de934b10008 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..91288a866e776 --- /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/2021-08-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..c038724537bc2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityRules Delete. */ +public final class SecurityRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4b3d4466d5445 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityRules Get. */ +public final class SecurityRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0d957b7a0ca04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SecurityRules List. */ +public final class SecurityRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1561841f074e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceAssociationLinks List. */ +public final class ServiceAssociationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..aca6eb6bddcec --- /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/2021-08-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/2021-08-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..436f4998da247 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies Delete. */ +public final class ServiceEndpointPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a8eb02d2d67ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies GetByResourceGroup. */ +public final class ServiceEndpointPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..202ca2737296c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies ListByResourceGroup. */ +public final class ServiceEndpointPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..50ef92385e060 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicies List. */ +public final class ServiceEndpointPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..67f5d38f91c9e --- /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.core.util.Context; +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/2021-08-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, 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..d1d5d638b56aa --- /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/2021-08-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..5c2243bf7049e --- /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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions Delete. */ +public final class ServiceEndpointPolicyDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..cb35b86efa522 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions Get. */ +public final class ServiceEndpointPolicyDefinitionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f3a28795415e3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ServiceEndpointPolicyDefinitions ListByResourceGroup. */ +public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..876e3b34de3de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.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.util.Context; + +/** Samples for ServiceTagInformation List. */ +public final class ServiceTagInformationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..49fceda0bd35d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceTags List. */ +public final class ServiceTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..99267ddf865d9 --- /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/2021-08-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/2021-08-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/2021-08-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..c616832645edb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Subnets Delete. */ +public final class SubnetsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..812ecde732685 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.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.core.util.Context; + +/** Samples for Subnets Get. */ +public final class SubnetsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..f4f6b699cc0fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Subnets List. */ +public final class SubnetsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1f3672447d258 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsPrepareNetworkPoliciesSamples.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.core.util.Context; +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/2021-08-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"), + 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..06d3f53e8d11a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.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.core.util.Context; +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/2021-08-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"), + 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..b532ed8ccbda0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.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.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e092b145e16dd --- /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/2021-08-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..e6547d2be3695 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites Delete. */ +public final class VirtualApplianceSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..faddf8d333250 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites Get. */ +public final class VirtualApplianceSitesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4dcdc87703936 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSites List. */ +public final class VirtualApplianceSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..26b5b18f9ca02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSkus Get. */ +public final class VirtualApplianceSkusGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..19f53634d5ed0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualApplianceSkus List. */ +public final class VirtualApplianceSkusListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..4d70c9d0a0ef3 --- /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/2021-08-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..78160ac95b8e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections Delete. */ +public final class VirtualHubBgpConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..39ac417dae502 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections Get. */ +public final class VirtualHubBgpConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5018789082cba --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections ListAdvertisedRoutes. */ +public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a306f55288b17 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections ListLearnedRoutes. */ +public final class VirtualHubBgpConnectionsListLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..6838a27b1adcb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubBgpConnections List. */ +public final class VirtualHubBgpConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bbafe47127490 --- /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/2021-08-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..9af181d8073c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration Delete. */ +public final class VirtualHubIpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..fd842ac8442a1 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration Get. */ +public final class VirtualHubIpConfigurationGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ac99aa7fd4676 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubIpConfiguration List. */ +public final class VirtualHubIpConfigurationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2c66d24af66fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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")), + 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..a1963ce77541a --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S Delete. */ +public final class VirtualHubRouteTableV2SDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5b9b88ce6b2ab --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S Get. */ +public final class VirtualHubRouteTableV2SGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..91c4dff071823 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubRouteTableV2S List. */ +public final class VirtualHubRouteTableV2SListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..123559cd94c42 --- /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/2021-08-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..85175a2f08e0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubs Delete. */ +public final class VirtualHubsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..240c8d7d7b08d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubs GetByResourceGroup. */ +public final class VirtualHubsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..dbb6bcbf2c7ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.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; + +import com.azure.core.util.Context; +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/2021-08-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"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..b82824f91265d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubs ListByResourceGroup. */ +public final class VirtualHubsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2071dc63186bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualHubs List. */ +public final class VirtualHubsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..e29ee6ce1d965 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..70cfa7d7663e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.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.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.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/2021-08-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) + .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..a6a7f036b6628 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections Delete. */ +public final class VirtualNetworkGatewayConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2901d23617074 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4493d8c50750e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetIkeSas. */ +public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..88679f561f39f --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections GetSharedKey. */ +public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..3ffdc59d96dad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections ListByResourceGroup. */ +public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..621699bd8eedf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayConnections ResetConnection. */ +public final class VirtualNetworkGatewayConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..81a6c12fec684 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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), 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..42fb23cb31301 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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"), 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..2dcdfc33e3930 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.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.util.Context; +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/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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}]}"), + 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..70cb0686b912a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.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.util.Context; +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/2021-08-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"), + 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..a42b31507d916 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..86dbc7e38ae69 --- /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/2021-08-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..41129b438f170 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules Delete. */ +public final class VirtualNetworkGatewayNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..27ea4e117c6bf --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules Get. */ +public final class VirtualNetworkGatewayNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0ba9184ca26d8 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. */ +public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b756c26d89461 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.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.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/2021-08-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("radiusServerSecret")))) + .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) + .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..bbe18e0e2d742 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways Delete. */ +public final class VirtualNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5e4f17122d22e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples.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.core.util.Context; +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/2021-08-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")), + 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..b2c9c89427c76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.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.core.util.Context; +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/2021-08-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(), 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..a2c5c2d778dbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.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.core.util.Context; +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/2021-08-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(), 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..5123243d67260 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetAdvertisedRoutes. */ +public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..116823f0e32e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetBgpPeerStatus. */ +public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..c57e4b9c03c00 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetByResourceGroup. */ +public final class VirtualNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..42e404794522b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetLearnedRoutes. */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b75c3da76b4ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. */ +public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..727e234a1ea8f --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnclientConnectionHealth. */ +public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..0d18168550137 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. */ +public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..f118cdfc30a14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ListByResourceGroup. */ +public final class VirtualNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e022a61ee83ef --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ListConnections. */ +public final class VirtualNetworkGatewaysListConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..354fe1ad129f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways Reset. */ +public final class VirtualNetworkGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..db997b15a6025 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways ResetVpnClientSharedKey. */ +public final class VirtualNetworkGatewaysResetVpnClientSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..8be5d5fe8c55d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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), + 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..b5c930cba363c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.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.util.Context; +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/2021-08-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}]}"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..41c0330331a7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.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.util.Context; +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/2021-08-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"), + 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..5a87c371ceba3 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkGateways SupportedVpnDevices. */ +public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..1bb2da148e86d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..b0b5ee9677f8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; +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/2021-08-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)"), + 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..5b1509156dced --- /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/2021-08-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/2021-08-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/2021-08-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..9544ad7d36f54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkPeerings Delete. */ +public final class VirtualNetworkPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e33f4c30edad2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.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.core.util.Context; + +/** Samples for VirtualNetworkPeerings Get. */ +public final class VirtualNetworkPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..2390db5a20a70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.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.core.util.Context; + +/** Samples for VirtualNetworkPeerings List. */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a6e4a66c3b9ec --- /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/2021-08-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..5560f7a5e3f26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps Delete. */ +public final class VirtualNetworkTapsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c503fbc7de95b --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps GetByResourceGroup. */ +public final class VirtualNetworkTapsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ac0695c5b2542 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps ListByResourceGroup. */ +public final class VirtualNetworkTapsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b93e0ddb1f861 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworkTaps List. */ +public final class VirtualNetworkTapsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..7e0ba543f840a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..6ccd81765370a --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks CheckIpAddressAvailability. */ +public final class VirtualNetworksCheckIpAddressAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4fe647860a0a1 --- /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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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/2021-08-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..6a44a5857b1d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks Delete. */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..540e08076d774 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.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.util.Context; + +/** Samples for VirtualNetworks GetByResourceGroup. */ +public final class VirtualNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..dbcc67ce7ea82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks ListByResourceGroup. */ +public final class VirtualNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..9ff87694a584c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks List. */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..44b21a813cd57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualNetworks ListUsage. */ +public final class VirtualNetworksListUsageSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..55b15ca490de8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.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.core.util.Context; +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/2021-08-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, 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..0bd97df4f5dd0 --- /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/2021-08-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..1799959338050 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings Delete. */ +public final class VirtualRouterPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..87f8378466814 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings Get. */ +public final class VirtualRouterPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..14359118c3141 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouterPeerings List. */ +public final class VirtualRouterPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..16dfe8ef6bb14 --- /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/2021-08-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..baebd50348caf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouters Delete. */ +public final class VirtualRoutersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b5ad3de9a6021 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouters GetByResourceGroup. */ +public final class VirtualRoutersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..83f269de6b6f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouters ListByResourceGroup. */ +public final class VirtualRoutersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e18cd4dd04893 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualRouters List. */ +public final class VirtualRoutersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..30994b818117d --- /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/2021-08-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..639c048ed984d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualWans Delete. */ +public final class VirtualWansDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bbe0368bbf097 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualWans GetByResourceGroup. */ +public final class VirtualWansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bd9ac8b939342 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualWans ListByResourceGroup. */ +public final class VirtualWansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..025751bcd77e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VirtualWans List. */ +public final class VirtualWansListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..66b8cefddb117 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..667ab9bfce7c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +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.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/2021-08-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("key") + .withUsePolicyBasedTrafficSelectors(false))), + 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..74ce625bb2f90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnConnections Delete. */ +public final class VpnConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a6e0416f2707b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnConnections Get. */ +public final class VpnConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bb3197bcc3e04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnConnections ListByVpnGateway. */ +public final class VpnConnectionsListByVpnGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..d3bb178144816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.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.core.util.Context; +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/2021-08-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")), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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")), + 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..1385f6199c15a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.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.core.util.Context; +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/2021-08-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")), + 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..e2df1968f0448 --- /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/2021-08-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("key") + .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..7f444308bfe79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnGateways Delete. */ +public final class VpnGatewaysDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..24795d9efa6df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnGateways GetByResourceGroup. */ +public final class VpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c4a9571b7377d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnGateways ListByResourceGroup. */ +public final class VpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..c40c2324cf3a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnGateways List. */ +public final class VpnGatewaysListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..e23b551b5792b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnGateways Reset. */ +public final class VpnGatewaysResetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..a64ad1e34ac65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.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.util.Context; +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/2021-08-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}]}"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..940bc14295a41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.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.util.Context; +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/2021-08-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"), + 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..5298e1ccca263 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..a1360c23aa842 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VpnLinkConnections GetIkeSas. */ +public final class VpnLinkConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e35e33f051fd2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VpnLinkConnections ListByVpnConnection. */ +public final class VpnLinkConnectionsListByVpnConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..e386db0e5b2a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.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.core.util.Context; + +/** Samples for VpnLinkConnections ResetConnection. */ +public final class VpnLinkConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..dd75534e314e5 --- /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; + +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurationsAssociatedWithVirtualWan List. */ +public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..22a721bd734e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.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.generated; + +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.VpnServerConfigRadiusClientRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigRadiusServerRootCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRevokedCertificate; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigVpnClientRootCertificate; +import java.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/2021-08-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("radiusServerSecret"))) + .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..5f9629e8d77eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations Delete. */ +public final class VpnServerConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..24a6882fec7b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.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.core.util.Context; + +/** Samples for VpnServerConfigurations GetByResourceGroup. */ +public final class VpnServerConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..65b33c74aa812 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations ListByResourceGroup. */ +public final class VpnServerConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..b78408d27ee80 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnServerConfigurations List. */ +public final class VpnServerConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..16b8943ae3dc3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.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.util.Context; +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/2021-08-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", 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..722e90d9e220c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinkConnections Get. */ +public final class VpnSiteLinkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..897ab71ff3701 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinks Get. */ +public final class VpnSiteLinksGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..7aa2219120cde --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSiteLinks ListByVpnSite. */ +public final class VpnSiteLinksListByVpnSiteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..79e3bcf9668b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.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.core.util.Context; +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/2021-08-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"), + 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..30e862e7d11f3 --- /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/2021-08-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..db1d49f55b876 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSites Delete. */ +public final class VpnSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..ab4d79f951741 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSites GetByResourceGroup. */ +public final class VpnSitesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..4ac60de425704 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSites ListByResourceGroup. */ +public final class VpnSitesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..12d08acaadeed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for VpnSites List. */ +public final class VpnSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..3bce5dc6b7816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.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.core.util.Context; +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/2021-08-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", 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..80a429c26fa69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.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.generated; + +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.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/2021-08-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")))) + .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..a945dfe9dbee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies Delete. */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..760cdad5712e7 --- /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; + +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies GetByResourceGroup. */ +public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..5a92fda9da9dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies ListByResourceGroup. */ +public final class WebApplicationFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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", 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..bd5264f9b0f75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WebApplicationFirewallPolicies List. */ +public final class WebApplicationFirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(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..9b6c330dd5b88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WebCategories Get. */ +public final class WebCategoriesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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, 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..3c06cc998d75f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for WebCategories List. */ +public final class WebCategoriesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-08-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(Context.NONE); + } +} diff --git a/sdk/network/ci.yml b/sdk/network/ci.yml new file mode 100644 index 0000000000000..2200a4d6c8a44 --- /dev/null +++ b/sdk/network/ci.yml @@ -0,0 +1,39 @@ +# 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 + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: network + Artifacts: + - name: azure-resourcemanager-network-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernetworkgenerated diff --git a/sdk/network/pom.xml b/sdk/network/pom.xml new file mode 100644 index 0000000000000..8c3d987e170df --- /dev/null +++ b/sdk/network/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-network-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-network-generated + + + +